Hi, thanks for your message. I decided to try to import into a new database on my own machine before logging a tech support ticket, and I’m having the same problem, so I don’t think it’s compatibility issues between the SQL versions.
I created a new database via phpMyAdmin. I purposely did not specify a collation, and it defaulted to latin1_swedish_ci (which is what the database I’m trying to export is as well, since I did not know to specify a collation when I first created it.)
I tried an import using a new backup file from the MODx manager first, and here is the error I got:
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String @ 231
STR: </
I’m assuming that means line 231 from the line which begins with "SQL:" so here’s what starts on line 231:
html, body, form, fieldset {
margin: 0;<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>MODx CMF Manager Login</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex, nofollow" />
I can’t see any difference in that code and the several bits around it. Maybe my mind is just not working. It wouldn’t be the first time!
Next, I tried exporting the existing database via phpMyAdmin and importing it into the new test database. This is the error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w’ at line 1
As I mentioned previously, I do have another MODx installation on my hosting server. So I tried creating a new database on the server, exporting the existing one via phpMyAdmin, and importing it into the new database. I got this error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w’ at line 1
I’m thinking that rules out compatibility between versions, as both of those databases were created on the same server via the same method.
I had begun to wonder if maybe the first database I was trying to import was corrupted, but the fact that I’m getting the same error through phpMyAdmin on two separate servers, with two separate MODx databases, indicates to me that I’m doing something wrong in either the export, or the import, or both. I am deliberately leaving all the options in phpMyAdmin at their defaults, apart from "Select All" for the tables when exporting.
When backing up from the MODx manager, I am ticking the box for "Table Name" to select all tables, and also ticking "Generate DROP TABLE statements." I have tried both with and without the "Generate DROP TABLE statements" ticked; same error.
So I am completely at a loss to figure out what the problem is, unless it’s the options I’m choosing upon export/import. I thought about reinstalling MODx, but now I’m not sure I could restore my existing database.
Is there information available as to exactly what options in phpMyAdmin should be chosen upon export/import? I have looked, but nothing I can find gives any specifics.
From the "Moving Site" article in the Wiki:
Dump (export) the local DB contents (use the Backup Manager, or any MySQL client such as phpMyAdmin). In phpMyAdmin, select SQL for the file type. Save to a file on your local machine and note the location. You will probably want to empty any log tables before backing them up, or else you’ll have rows and rows of log data useless to your new server.Then go to the remote server and import the SQL dump you saved. In PhPMyAdmin, select the database and "import" the SQL file.
The "Upgrading" article on the Wiki:
# Backup everything. Download all your files with your FTP client to your hard drive. Use phpMyAdmin or whatever database utility you have to "dump" your entire database to your hard drive.
I have a copy of the MODx Web Development eBook, and I honestly can’t see any difference between what I am doing and what the book advises to do on importing and exporting (comparing the screenshots, etc.)
Maybe I did something wrong when creating the two databases I’ve tested, but again, I can’t find any specific information on options to choose when creating a database for MODx to use. I just created a database in phpMyAdmin with the defaults, near as I can remember
I am very much hoping that this is something very simple and basic (and easy to find) that I’ve done wrong with these two databases. It’s got to be something I’m doing wrong somewhere; otherwise I’d think the forums would be full of messages from other folks.