News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Moving Host - Database Export error

Started by Gilrod, April 02, 2011, 02:47:34 PM

Previous topic - Next topic

Gilrod

Hey,
When I run the DB export/backup tool within SMF it saves out around 10MB then stops.

When I take a look at the SQL file saved out, at the very end of it is the following ...

<b>Fatal error</b>:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 261619799 bytes) in <b>/home/tnmscom1/public_html/Sources/DbExtra-mysql.php</b> on line <b>325</b><br />

Is there anyway to resolve this?

Thanks in advance.

Stewart

MrPhil

Use a proper tool such as phpMyAdmin to export and import databases. If you have an exceptionally large database, you may need more specialized tools to do this, or with guidance from your host and knowledge of SQL, you might create/break up the database into multiple smaller .sql files and import them in order. Just make sure the .sql file(s) you create includes commands to drop old tables and create new ones, or just fills in the data (if you know that you have the right tables already created and you've emptied them first).

Gilrod

Yeah did that, and therein lies the problem...

Our new host, as with MOST hosts, do NOT allow SQL imports of more than 10MB.

So with a 264MB DB you can see my quandary.

Usually I use the MySQL Windows Admin tool, but our new host does NOT allow remote access.


MrPhil

If you have an oversized .sql file, you can cut it apart with a text editor (it's just an ordinary text file). Then, import each fragment. Just be sure to keep everything involved with a given table together in one .sql file, if you can. In any case, make sure you do any DROP and CREATE on a table before you start INSERTing data, and be careful not to split in the middle of an INSERT statement. Other than that, it doesn't matter what order you INSERT rows within a table, or in what order you create and fill tables.

The 10MB limit on SQL imports is to avoid hogging the database and hurting performance for other users. Just break up the SQL into smaller pieces and run them separately, so as not to bog down the system.

busterone


Bigguy

Can you not pass the .sql file to your host and have them upload it. ???

Gilrod

Quote from: Bigguy on April 02, 2011, 06:29:57 PM
Can you not pass the .sql file to your host and have them upload it. ???

This is my next option after I try bigdump :)

Acans

Gilrod, where you able to solve your moving issues?
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Gilrod

Of sorts, had to get old host to do an export for us at the mysql command line level. And the new host did the same for us to re-import.

But we could NOT do it ourselves.

Bigguy


Advertisement: