Help - Search - Members - Calendar
Full Version: backups/restore of mySQL
Hostony Board > General Support > General Support
wendas
For backup & restore I have been using the following

Backup : in phpmyadmin I select full database then Backup from export, save file _DB_ compression (none)

Restore : I first delete all the tables then I run the script created from the Backup in the phpmyadmin SQL section..

I have run both the backups & the restores several times as I am in test and need to put test data in then clear out the file & try again.. but with very little in my database I get an error that I can only describe as a error due to the size of the script, because if I split the script into 2 scripts with each only having half the tables in it runs with no error.. (this splitting I usually am doing by manually, after the single script errors out.)

This causes me concern about how I will ever restore from any backups I make after we go live.. These files will be much bigger..

So am I not doing my backup & restore correctly? Is there a better way that will work if you have true data in your files?

Wenda
MartinB
if you have a linux plan, you can ask for ssh shell access to support, and then you can use the mysql command line for make the inserts.

e.g. mysql -u username -p database_name < your_dump_file.sql

you can also do the dump backup file with:

mysqldump -u user -p --opt database_name > file_name.sql
wendas
I have seen reference to this type of backup, but it seems a little confusing.. And no one would mention the restore, so I did not like a backup I could not restore from.. (I thought myself lucky I had something easier, but I guess I must learn this if it will let me do a serious backup / restore)

Do I have it right that the Backup is :
QUOTE
mysqldump -u user -p --opt database_name > file_name.sql
and the Restore is..
QUOTE
mysql -u username -p database_name < your_dump_file.sql


This seems to be for 1 file, can you do it for a complete database backup?

if wanting to do a complete wipe down & reset would I first delete the table or all the tables in the db then run the restore?

is username the name of my domain.. or the username that I enter with the password to get to my control panel?

Wenda
MartinB
QUOTE
This seems to be for 1 file, can you do it for a complete database backup?
this is for a whole database.
you can use the option -A, --all-databases for dump all the databases. This will be same as --databases with all databases selected.


QUOTE
if wanting to do a complete wipe down & reset would I first delete the table or all the tables in the db then run the restore?


no, the --opt option generate a DROP TABLE IF EXIST. so if you import the dump file, it will remove all table "if exist"

QUOTE
is username the name of my domain.. or the username that I enter with the password to get to my control panel?


use your account username/password

also, you can type:
mysqldump --help
and you will get a description of all the parameters.

greetings
supergodoffunk
I've been backing up and restoring just fine with myphpadmin. Just use the default, pick all the tables, and DONT select compression.

I couldn't get it to restore with compression also, zip or tar.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here