I’m migrating wordpress websites. Importing the SQLdump from the old server with phpmyadmin returns syntax error’s.
Exporting from:
phpMyAdmin SQL Dump
version 4.2.8.1
Serverversie: 5.5.37
PHP-versie: 5.3.29
Importing:
phpMyAdmin
version 4.5.0.2
Serverversie: 5.5.44-MariaDB
PHP-versie: 5.5.30
Syntax error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'about', 'about', '{"title":"about","alias":"about","shortcode":"[rev_slider abou' at line 2
SQl-query. Note, the first 13 tables import without problems
INSERT INTO `d8up675e4c_revslider_sliders` (`id`, `title`, `alias`, `params`) VALUES
(2, 'Full-Screen-1', 'Full-Screen-1', '{"title":"Full-Screen-1","alias":"Full-Screen-1","shortcode":"[rev_slider Full-Screen-1]","source_type":"gallery","post_types":"post","post_category":"category_41","post_sortby":"ID","posts_sort_direction":"DESC","max_slider_posts":"30","excerpt_limit":"55","slider_template_id":"","posts_list":"","slider_type":"fullscreen","fullscreen_offset_container":"","fullscreen_min_height":"","full_screen_align_force":"off","auto_height":"on","force_full_width":"on","responsitive_w1":"940","responsitive_sw1":"770","responsitive_w2":"780","responsitive_sw2":"500","responsitive_w3":"510","responsitive_sw3":"310","responsitive_w4":"0","responsitive_sw4":"0","responsitive_w5":"0","responsitive_sw5":"0","responsitive_w6":"0","responsitive_sw6":"0","width":"1160","height":"1000","delay":"5000","shuffle":"off","lazy_load":"off","use_wpml":"off","stop_slider":"off","stop_after_loops":0,"stop_at_slide":2,"load_googlefont":"false","google_font":["<link href=''http:\/\/fonts.googleapis.com\/css?family=PT+Sans+Narrow:400,700'' rel=''stylesheet'' type=''text\/css''>"],"position":"center","margin_top":0,"margin_bottom":0,"margin_left":0,"margin_right":0,"shadow_type":"0","show_timerbar":"hide","padding":0,"background_color":"#000000","background_dotted_overlay":"none","show_background_image":"false","background_image":"http:\/\/domain.com\/wp-content\/","bg_fit":"normal","bg_repeat":"repeat","bg_position":"center top","touchenabled":"on","stop_on_hover":"off","navigaion_type":"bullet","navigation_arrows":"solo","navigation_style":"round","navigaion_always_on":"false","hide_thumbs":200,"navigaion_align_hor":"center","navigaion_align_vert":"bottom","navigaion_offset_hor":"0","navigaion_offset_vert":20,"leftarrow_align_hor":"left","leftarrow_align_vert":"center","leftarrow_offset_hor":20,"leftarrow_offset_vert":0,"rightarrow_align_hor":"right","rightarrow_align_vert":"center","rightarrow_offset_hor":20,"rightarrow_offset_vert":0,"thumb_width":100,"thumb_height":50,"thumb_amount":5,"hide_slider_under":0,"hide_defined_layers_under":0,"hide_all_layers_under":0,"hide_thumbs_under_resolution":0,"start_with_slide":"1","first_transition_type":"fade","first_transition_duration":300,"first_transition_slot_amount":7,"reset_transitions":"","reset_transition_duration":0,"0":"Execute settings on all slides","jquery_noconflict":"on","js_to_body":"false","output_type":"none","template":"false"}'),
Tested the following.
Test 1.
Tried other DB dumps (from old server), but they also return syntax errors.
Test 2.
Command line mysqldump
old server, Command line mysql import new server.
This works without errors. But when I then try with phpmyadmin (new server) ‘export/clear db/import’ I get the same errors?
Test 3.
Clearing the params
value:
INSERT INTO `d8up675e4c_revslider_sliders` (`id`, `title`, `alias`, `params`) VALUES
(2, 'Full-Screen-1', 'Full-Screen-1', '{}'),
(3, 'about', 'about', '{}'),
(4, 'our-story', 'our-story', '{}'),
(5, 'Screens', 'screens', '{}');
Now all CREATE TABLE
and INSERT INTO
complete without error’s. But I get the following syntax error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ALTER TABLE `d8up675e4c_commentmeta`
ADD PRIMARY KEY (`meta_id`),
ADD KEY `c' at line 133
SQL-query
INSERT INTO `d8up675e4c_wpsl_stores` (`wpsl_id`, `store`, `address`, `address2`, `city`, `state`, `zip`, `country`, `country_iso`, `lat`, `lng`, `description`, `phone`, `fax`, `url`, `email`, `hours`, `thumb_id`, `active`) VALUES
(1, 'Shoes shop | Office', 'street 181', '', 'demo city', 'Noord-Brabant', '1111 TM', 'Nederland', 'NL', 51.675339, 4.995821, '', '', '', 'www.domain.com', 'info@domain.com', '', 3065, 1),
(5, 'April Fashion & Shoes', 'street 1', '', 'VALKENS[...]
Error ALTER TABLE
ALTER TABLE `d8up675e4c_commentmeta`
ADD PRIMARY KEY (`meta_id`),
ADD KEY `comment_id` (`comment_id`),
ADD KEY `meta_key` (`meta_key`(191));
To be extra clear, these are syntax errors when I use phpmyadmin (on the new server) to ‘export/clear db/import’…. I used the command line to import the SQL file from the old server.
Tried many different phpmyadmin export settings on the old server, but every time I get the same errors on the new server.
When I export/import websites that are created on that server it works without problems. This is the same for the old server..
No idea what to test anymore, i can’t find the solution..
Clearly it has something to do with the different MySQl or phpmyadmin versions. How to resolve that?
Regards,
Bjorn
Found the problem…
After hours off testing I found that the following value is not accepted by the MariaDB:
\''
Only in a few DB dumps I find this, around 10 occurrences in each dump, mainly inside url’s..
Some plugins on the old server have saved their settings with
\''
inside it.Example that fails on import with syntax error
Notice the
\''
inside the url, replacing them with ” fixes all import problems.