MyBB Community Forums

Full Version: 1.6.6 Upgrade screwup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know it's my fault and I was trying to be too careful and not thinking enough about what I was doing. Unfortunately I seem to have lost my BB after trying to upgrade from 1.6.4 to 1.6.6.

In order that I could go back to where I was in case of problems (running myBB on local server), I renamed the old installation folder and created a new folder with the old name. I then started a new installation (which I now realise was not an upgrade to my existing installation). I entered all the details of the database, which it accepted but when I went to the board, there is no data installed. I thought I could get it all back from my database backup but when I go through this procedure in phpMyAdmin, after a while I get the following text output:

Error

SQL query:

-- MyBB Database Backup
-- Generated: 10th March 2012 at 17:02
-- -------------------------------------
CREATE TABLE mybb_adminlog (
uid int( 10 ) unsigned NOT NULL DEFAULT '0',
ipaddress varchar( 50 ) NOT NULL DEFAULT '',
dateline bigint( 30 ) NOT NULL DEFAULT '0',
module varchar( 50 ) NOT NULL DEFAULT '',
action varchar( 50 ) NOT NULL DEFAULT '',
data text NOT NULL ,
KEY module ( module , action )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;

MySQL said: Documentation
#1046 - No database selected

Can anybody advise me as to how I can get out of this situation? I've replaced my old installation files (still 1.6.4) but the data remains empty.

do you have a MYSQL backup of your site at all (a recent one)? if so you can restore that ?

sorry i see that you have. Your erro suggests that your trying to restore t o a database that is not correct


I followed the procedure outlined in this post:

http://wiki.mybb.com/index.php/Database_Restore

Has the new installation created a new database with the same names and references as the previous one that I cannot restore? I don't know enough about SQL databases to work this out.........
I realised later, after trawling through other posts regarding backup restores that I hadn't selected the database to restore to, so having gone back to try again, I now get a different error output which ends in

MySQL said:
#1050 - Table 'mybb_adminlog' already exists.

I don't know enough about SQL databases to really interpret this. Any ideas anybody? The full message is as follows:
--------------------------------------------------------
Error

SQL query:

-- MyBB Database Backup
-- Generated: 10th March 2012 at 17:02
-- -------------------------------------
CREATE TABLE mybb_adminlog (
uid int( 10 ) unsigned NOT NULL DEFAULT '0',
ipaddress varchar( 50 ) NOT NULL DEFAULT '',
dateline bigint( 30 ) NOT NULL DEFAULT '0',
module varchar( 50 ) NOT NULL DEFAULT '',
action varchar( 50 ) NOT NULL DEFAULT '',
data text NOT NULL ,
KEY module ( module , action )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;

MySQL said: Documentation
#1050 - Table 'mybb_adminlog' already exists
to do a restore you should not need to install anything just upload the files, Restore the database back up to the database and ensure your config and settings files are correct
When you upgrade next time, please read the documentation first before trying anything: [Wiki: Upgrading] (Broken link, head over to docs.mybb.com instead)

Both these errors are pretty clear though. "No database selected" means you didn't select a database before you tried to import the backup so it didn't know where to go. "Table 'mybb_adminlog' already exists" means what it says, a table with that name already exists, and it can't import another one with the same name. The new installation created all the tables again with their default data, you'll need to drop all these tables and import the backup after that.
as long as your database details are the same (i.e name,host,password,user) it should automatically connect with the data stored in the config.php Just upload your old forum files and as Matt said drop all the tables from the database then import the backup file.
Thanks to Matt (who has often helped me in the past!) and Hagz. I now have the board back to pre-upgrade and will now upgrade to latest version while I'm not so tired. It's not as if I hadn't read the upgrade instructions, I was just trying to be extra careful but was stupid at the same time!!!

Roger your welcome these are easy mistakes to make and your experience could well help others out, as i have undoubtedly need similar help in the past.