MyBB Community Forums

Full Version: MyBB 1.6 Database Backup File not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello to all,

Every week I make a backup file of my forum and lately I have decided to upgrade my 1.412 version to 1.6 seeing how 1.6 requires a fresh install anyway.

I have many backup files from the month of May all the way to the present time of our forum (via several forum software upgrades along the way).

Upon performing a normal upgrade, I would install fresh software, while pointing to the new freshly and empty created SQL database and then I would use the MySQL import manager to import from my backup file to update everything i.e. posts, users, etc.

However this has gone horribly wrong.

My backup file from 1.412 does not work, and I get SQL errors saying the admin log, etc. already exists and nothing is updated.

If I go back in time to each week before and try to import, I get the same results until I get back to Jun 19th, 2010 where I was using 1.411 (just before I upgraded) and this backup file works time in importing, each and every time I have tried.

If i delete this and go back to the recent Oct 2nd backup file create by MyBB 1.6, I get the same SQL errors messages Adminlog, etc. already exists.

If I import my June 19th, file from 1.411 then the imports goes fine without an issue and allows me to perform the upgrade without further issues.

I have tried this multiple times, going back to Oct 2nd backup, September backups, Augugst backups nothing works except the old June backup from several software revisions earlier.


Question: is there a problem with the MyBB 1.6 admin forum backup generation file that has slipped or carried over from 1.412 that prevents it from being correctly imported?


Note: if create a backup using MyBB 1.6 via the built in backup from admin panel, and then create another MyBB 1.6 forum and a fresh new empty database and then import the backup, it fails to import via the SQL php manager saying, adminlog, table, etc. already exists and stops the import process.

Please advise,


Thank you,


Owen
First off, 1.6 doesn't require a fresh install.

If it's saying tables already exist it's exactly that, the database you're importing your backup to already contains tables that are in your backup; i.e. the database you're importing to already has an adminlog table, and your backup has an adminlog table in it, so it can't import. It's not a problem with the backup itself. You just need to import it to an empty database, or drop the tables in the current database if you're sure you don't need them.
(2010-10-04, 07:56 PM)MattRogowski Wrote: [ -> ]First off, 1.6 doesn't require a fresh install.

If it's saying tables already exist it's exactly that, the database you're importing your backup to already contains tables that are in your backup; i.e. the database you're importing to already has an adminlog table, and your backup has an adminlog table in it, so it can't import. It's not a problem with the backup itself. You just need to import it to an empty database, or drop the tables in the current database if you're sure you don't need them.

Hi Matt,

Thank you for responding, however, I cannot get this to work.

In order to install MyBB 1.6, it requires being locked into a data base that exists whether it is empty or not, and if it is not empty, it will be when MyBB 1.6 installs using it.

Therefore if I create an empty database and install MyBB 1.6 it creates the adminlog, etc. which negates my efforts to import the backup file.

If I select the newly empty sql file in the php manager after having installed MyBB 1.6 and through the SQL manager drop the adminlog, etc. tables and then try the import SQL function to my backup I still get continued sql error messages on importing.

What other options do I have? how can this be made easier to do, to resurrect a forum?

If I continue to cycle through the process to see what errors develop and then drop those via the SQL manager, it only creates more problems, so I am unsure as to why the backup/import function is not working, and yet, if go back to my June 19th file, it works fine.


Owen



You don't need to install 1.6, you just upgrade a 1.4 database. You do not need to run the 1.6 installation script. If you need to use this database backup as opposed to the database you've already got, then either drop the current database or just import it to a fresh one. I think you're misunderstanding the process a bit.

1.4 forum = 1.4 files, on a 1.4 database.
To upgrade = upload 1.6 files over 1.4 files. 1.4 database is untouched. Run upgrade script, database is upgraded.

If you've already got data in a database, why do you need to import this backup??
(2010-10-04, 08:17 PM)MattRogowski Wrote: [ -> ]You don't need to install 1.6, you just upgrade a 1.4 database. You do not need to run the 1.6 installation script. If you need to use this database backup as opposed to the database you've already got, then either drop the current database or just import it to a fresh one. I think you're misunderstanding the process a bit.

1.4 forum = 1.4 files, on a 1.4 database.
To upgrade = upload 1.6 files over 1.4 files. 1.4 database is untouched. Run upgrade script, database is upgraded.

If you've already got data in a database, why do you need to import this backup??

Well seems like I never read what you are talking about, I have read to do an install. And this is all water under the bridge, as I have done a fresh install of MyBB 1.6.

I have to tell MyBB 1.6 which data file to use as part of the installation process, and of course once I do, it promptly erases the data in that database upon installation, hence the reason I am attempting to import the SQL backup.

Is it possible to have an option not to erase the database once MyBB 1.6 makes initial contact with the database?

What are my best options to recover form where I am at?

Thank you,

Owen
I don't know where you read that the upgrade to 1.6 requires you to install it fresh as it's certainly not in our documentation. Your forum already knows what database it's using, that's how your 1.4 forum worked.

So what's in your actual database now then?? The empty tables the 1.6 installer created?? If it is, just drop them and import the backup. As I said before, the only reason you're getting this error is because the backup is trying to import a table that already exists...

All you had to do to upgrade was upload the new files and run the upgrade script. Installing fresh and then messing about with backups is totally unnecessary. You're still going to have to run the upgrade script anyway because you're going to be importing a 1.4 database... Undecided

(2010-10-04, 08:28 PM)coolcos Wrote: [ -> ]Is it possible to have an option not to erase the database once MyBB 1.6 makes initial contact with the database?

That's the point, you didn't need to run the installer and wipe the database, I don't know why you did.
(2010-10-04, 08:29 PM)MattRogowski Wrote: [ -> ]I don't know where you read that the upgrade to 1.6 requires you to install it fresh as it's certainly not in our documentation. Your forum already knows what database it's using, that's how your 1.4 forum worked.

So what's in your actual database now then?? The empty tables the 1.6 installer created?? If it is, just drop them and import the backup. As I said before, the only reason you're getting this error is because the backup is trying to import a table that already exists...

All you had to do to upgrade was upload the new files and run the upgrade script. Installing fresh and then messing about with backups is totally unnecessary. You're still going to have to run the upgrade script anyway because you're going to be importing a 1.4 database... Undecided

(2010-10-04, 08:28 PM)coolcos Wrote: [ -> ]Is it possible to have an option not to erase the database once MyBB 1.6 makes initial contact with the database?

That's the point, you didn't need to run the installer and wipe the database, I don't know why you did.
OK, thanks!

It sounds like there is not a friendly way to perform a restore function for MyBB, without spending a lot of time understanding SQL syntax and data structure.

Thank you all for answers and comments.


Owen
(2010-10-04, 08:38 PM)coolcos Wrote: [ -> ]It sounds like there is not a friendly way to perform a restore function for MyBB, without spending a lot of time understanding SQL syntax and data structure.

What?? You're still not understanding what the problem is here if that's your outcome. This is nothing MyBB has any control over whatsoever. This could happen with absolutely any database and backup. Let me break it down for you.

You have a database.
In this database is a table called mybb_adminlog
You are trying to import a backup.
In this backup is a query to create a table called mybb_adminlog
When phpMyAdmin sees this it thinks "Hang on, there's already a table with this name, I can't insert it again", and shows the error saying it already exists.
Thus, it cannot import.

You don't need to understand anything about SQL, you just need to understand that a backup cannot be imported if it tries to create a table that already exists. If you drop the existing tables, or import to an empty database, it will not say the tables already exist, as they won't already exist.
(2010-10-04, 08:41 PM)MattRogowski Wrote: [ -> ]
(2010-10-04, 08:38 PM)coolcos Wrote: [ -> ]It sounds like there is not a friendly way to perform a restore function for MyBB, without spending a lot of time understanding SQL syntax and data structure.

What?? You're still not understanding what the problem is here if that's your outcome. This is nothing MyBB has any control over whatsoever. This could happen with absolutely any database and backup. Let me break it down for you.

You have a database.
In this database is a table called mybb_adminlog
You are trying to import a backup.
In this backup is a query to create a table called mybb_adminlog
When phpMyAdmin sees this it thinks "Hang on, there's already a table with this name, I can't insert it again", and shows the error saying it already exists.
Thus, it cannot import.

You don't need to understand anything about SQL, you just need to understand that a backup cannot be imported if it tries to create a table that already exists. If you drop the existing tables, or import to an empty database, it will not say the tables already exist, as they won't already exist.

Matt,

I have figured out the method required to install a backup file to ensure compatibility!
Note: dropping tables did not work, there were too many other SQL error messages.

Owen
Compatibility?? I have no idea what you've had to do here but it more than likely wasn't necessary. As I said, you didn't need to do any of this and you only made more work for yourself, but if it's sorted then that's good.