(Copy of a support ticket, just submitted to the host's support crew.Oh dear. This is a trap for the unwary.
I had the idea of setting up a test site in a sub-domain. This was easy (basic phpBB install to new sub-domain). Then I wanted to import a backup of the live site as a basis for the test site.
So, I go to the nifty cPanel backup/restore page (../frontend/paper_lantern/backup/index.html) and I notice that it exports backups using the name of the relevant db for the gzipped SQL file.
Ok, that's sensible. So I look around for a way to select the db you want to import to. Nothing found.
Ok, if no controls available, assume it will import to the db that has a name matching the .sql.gz file. Can't see any other basis for it.
So, rename live site backup file to match the name of the test site db. Import file.
Success! Imports beautifully. Except: it imports to the live site db, not to the test site db.
IOW, the cPanel restore code seems to just restore to the database that is alphabetically first on the list, with no possibility of restoring to another db later in the list.
Am I missing something here?
![Laughing :lol:](./images/smilies/icon_lol.gif)
I've restored this site to the latest backup available. Fortunately I've been taking them every 24 hours, so we haven't lost much. And at least we know the backups are good.
![!DUH! *!*!*!](./images/smilies/smilie120.gif)
Edit: Got cPanel figured out. When it makes a backup file it writes the name of the db it was exported from on the third line of the file. That's what cPanel reads when you try to import a file. So to import a a backup of Site 1 db to the Site 2 db:
1/ Export Site 1 db.
2/ Extract on desktop.
3/ Rename extracted SQL file to match name of second db (that you want to import to).
4/ Edit third line of SQL file to match the name of the db you want to import to.
5/ Gzip the resulting file.
6/ Import via cPanel space monkeys.
7/ Hey! It works this time.
![cheers (0!!0)](./images/smilies/cheers.gif)