Please advise on how to backup database (and restore if necessary)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Please advise on how to backup database (and resto...
Please advise on how to backup database (and restore if necessary)
26-03-2014 9:55 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator

This has highlighted that I need to be backing up the database locally, however I'm not sure of the best way of doing it.
Looking at the phpMyAdmin screen it lists two databases, although I only have one WordPress install.
Both end with (ccgijtxxxx4xxxxx) but the numbers at the end are different. However they seem to be the same thing and repairing the table in one repaired it in the other, so that's confused me.
To make a backup, do I just select the top database in phpMyadmin and choose 'Operations' then use 'Copy Database To'?
What do I put as a location under the Copy Database To heading?
Are the default options of 'Data and Structure', 'CREATE DATABASE before copying' and 'Add AUTO_INCREMENT value' sufficient?
I could probably find a WordPress plugin to do the backups, but I'm not sure what to trust to get the job done properly.
Once I've got a backup, how would I restore it should the need ever arise? Is it just a case of going to 'Import' in phpMyAdmin and entering the name of the backup file and click Go?
Apologies for all the questions.
- Jules.
Re: Please advise on how to backup database (and restore if necessary)
27-03-2014 12:07 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
To backup this database you should select and open it in the phpMyAdmin left-hand panel, than go to the Export tab. (The Operations tab is used for copying tables between database whereas you need to export them to a file on your PC.)
On this tab, select "Custom", and make sure all tables are selected/highlighted.
Modify the content of the File name template textbox to @DATABASE@-%Y-%m-%d
to add the date to the file name of the dump file.
Select gzipped from the Compression drop down menu.
In Object creation options tick Add DROP TABLE statement,
Remaining settings should be left at their default values.
Now click Go … and wait.
After 2-3 minutes your browser download dialogue should display to handle saving the file to your PC.
If you ever need to restore the complete database you use the Import tab, browse to locate the file on your PC and click Go.
Complications arise if you only want to import a few tables. The simplest solution is perhaps to create another empty database and import the complete backup into that. Using Operations/Copy table is the obvious way to copy it across but I suspect access permissions wouldn't allow that. You'd probably have to export just the relevant tables then import these into the original database.
David
Re: Please advise on how to backup database (and restore if necessary)
27-03-2014 1:10 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks for the detailed instructions.
However, when I click Go when using Internet Explorer it comes up with Error 500 and if I do the same steps using Google Chrome I get 'No web page was found for the web address http://ccgi.xxxxxxxx.plus.com/phpmyadmin/export.php'. ; No browser download dialogue.

- Jules.
Re: Please advise on how to backup database (and restore if necessary)
27-03-2014 10:29 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Exporting using the settings I suggested works OK for me.
David
Re: Please advise on how to backup database (and restore if necessary)
27-03-2014 11:34 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Re: Please advise on how to backup database (and restore if necessary)
27-03-2014 4:36 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Please advise on how to backup database (and restore if necessary)
27-03-2014 4:40 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I've removed your old databases and replaced them with a single user. Password's the same but the database name and username are different (I've updated your wp-config file). I was hoping this would sort the phpMyAdmin export problem out but it hasn't so I'm still working on that. Note that you'll not be able to get into phpMyAdmin at the moment. Try not to touch that until you've heard back from me.
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Re: Please advise on how to backup database (and restore if necessary)
27-03-2014 4:50 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Bob I've removed your old databases and replaced them with a single user. Password's the same but the database name and username are different (I've updated your wp-config file).
Thank you.
Quote Note that you'll not be able to get into phpMyAdmin at the moment.
OK
Re: Please advise on how to backup database (and restore if necessary)
04-04-2014 12:20 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Any news on how I can make a database backups?
Regards,
Jules,
Re: Please advise on how to backup database (and restore if necessary)
04-04-2014 3:29 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Using the details from your wp-config file though you should be able to use an alternative like Adminer or MySQL Administrator.
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Re: Please advise on how to backup database (and restore if necessary)
04-04-2014 7:32 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
What options do I choose in the box above the Export button?
At the moment the options are:
Output: open (I'm guessing I should change that to gzip or Save).
Format: SQL
Database: Is blank with Routines and Events ticked.
Tables: DROP+CREATE with Auto Increment unticked and Triggers ticked. (Doesn't DROP mean delete? Do I change that to just CREATE?)
Data: INSERT
There doesn't appear to be an help files anywhere and I don't want to risk damaging the database by clicking on something incorrectly.
Are there any security issues with having the php file in a subdirectory of /public? What file permissions should I set?
Regards - Jules.
Re: Please advise on how to backup database (and restore if necessary)
05-04-2014 2:06 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
(open lists the file on the screen, save downloads an uncompressed file - 5-10 times larger)
Format you want SQL
Database leave the text box empty, with routines and events ticked
Tables leave as DROP+CREATE, Auto-Increment unticked, Triggers ticked.
(DROP+CREATE is what will happen on a restore and you want the old table deleted first).
Data leave as INSERT
(there won't be anything to UPDATE on a complete restore)
For a complete database dump ensure the Tables and Data heading checkboxes are ticked (which ticks all rows).
If you want to dump a prefixed selection, untick everything and select the prefix required at the bottom of the table. Make sure appropriate rows for both Tables (on the left) and Data (on the right) get ticked.
Now click the Export button. After a while a standard download dialogue box should open for managing dump file download to your computer.
Should you need to restore the file you use the Import button, browse to locate the dump file on your computer, and click the execute button.
Permissions for the adminer executable can be left as 644. Anyone trying to interfere with your database has know its name and password.
David
Re: Please advise on how to backup database (and restore if necessary)
05-04-2014 6:00 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks again for your help. I feel much happier now that I have all my files and the database backed up locally.
Kind regards,
Jules.
Re: Please advise on how to backup database (and restore if necessary)
09-04-2014 6:28 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Something like:
#!/bin/bash
echo "Content-type: text/plain"
echo
# Add in your mysql details here
MYSQL_HOST=
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_DATABASE=
# Add in your email address
EMAIL=
#Select files to backup
# . backs up everything
# or select files and folders
# between quotes, e.g.:
# "mysql_backup.sql wordpress/wp-content/ foo.txt bar/foo.txt"
BACKUPFILE="mysql_backup.sql"
#Nothing more to add
DATE=$(date +'%Y-%m-%d')
cd ~/public
mysqldump --opt -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE > mysql_backup.sql
cat <<EOF> tmpfile.txt
To: $EMAIL
From: $EMAIL
Subject: Backup on $DATE
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=$DATE-backup
--$DATE-backup
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
See attached.
--$DATE-backup
Content-Type: application/x-tgz
Content-Disposition: attachment; filename=backup.tar.gz
Content-Transfer-Encoding: base64
EOF
if [ -e $BACKUPFILE ]
then
tar -czf - $BACKUPFILE | openssl base64 >> tmpfile.txt
cat <<EOF>> tmpfile.txt
--$DATE-backup--
EOF
fi
cat tmpfile.txt | /usr/sbin/sendmail -t -i
rm tmpfile.txt mysql_backup.sql
echo "Backup sent to "$EMAIL
Gabe
Re: Please advise on how to backup database (and restore if necessary)
10-04-2014 2:46 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: jtonline However, when I click Go when using Internet Explorer it comes up with Error 500 and if I do the same steps using Google Chrome I get 'No web page was found for the web address http://ccgi.xxxxxxxx.plus.com/phpmyadmin/export.php'. ; No browser download dialogue.
To conclude, Hostopia have confirmed that this is happening because your database is hitting size limits (set to the default 128M I'm told). I tried it with another customer's database that's bigger than yours and encounter the same problem.
Looks like you'll have to settle for one of the alternative methods rather than relying on phpMyAdmin for back-ups (the alternatives are probably a lot quicker anyway if I'm honest).
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Please advise on how to backup database (and resto...