Filed under:

How do I backup and restore my Website and Databases.




    Backup your site
  1. Login to your old cpanel and click "backup"
  2. Once in backup click "download a home directory backup" This will backup all your email accounts, files, and a few other things. It will not backup your mysql databases.
  3. If you have any mysql databases you will download them now.
  4. If you have any Alias/ Filter Backups download them.
You have now backed up your entire site.

    Restore your site
  1. Login to your new cpanel and click "backup"
  2. Under "restore a home backup" Click "Browse" and find the home backup you have you have already downloaded, and click upload.
  3. Do the same for your mysql databases.
  4. Do the same for your Alias/Filters.
You have now restored your entire site.

Fixing Databases after restore After you have restored your database you may get an error when trying to view a page that users the database (forum, script, phpmyadmin etc).

Warning: mysql_connect(): Access denied for user: 'domain_dbse@localhost' (Using password: YES) in
/home/domain/public_html/forum/includes/database.php on line 13
Unable to connect to database server!

This means that your database now exists in cpanel, but it has no mysql username and password assigned to it. To assign a username and password login to your cpanel and click "mysql databases" and add the user, and assign appropriate rights to it.

Your username will look something like this yourusername_databasename@localhost
The username in our example error above is "domain_dbse"
You will need to find out your database password for scripts/forums etc. To do so look at the error your page gave you and take notice of the path.

Path from our example error:
/home/domain/public_html/forum/includes/database.php on line 13 Login to your site by FTP and go through to the approprate folders/path until you find the file listed in your error. Download the file to your computer. Once it has been downloaded, open the file and look for your database password. Look for a line like
DB_SERVER_PASSWORD = ('abc123xyz');

Now fill that password in for the database password, and and then press "add user"

The user has now been added, but it has not been assigned to a database.

Match up the user with the database it belongs to and then just click "add user to database"

All done! If it doesn't work you missed a step somewhere and should create a support ticket for assistance.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
article icon What is PHP? (Views: 2012)

Language: