I'm trying to create a test environment from a working production system of Drupal 7.
I download the production files (fixing settings.php), create a backup of the production DB, create an empty local DB, update settings.php, create a new local instance of Drupal (minimal or common), and activate the backup and migrate module.

Everything seems ok and I restore the recently created backup file.
The problem is that after a few minutes, the restore completes but the newly restored site is not available.
Any attempt to access the site results in a "This Web Page is not available" and includes a reference to "Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.". (the same type of error shows up with IE and Chrome)

I've done the backup and restore several times before with no problem with this very same site.
What could be the problem now?
I've seen situations where a PHP error screen shows up, but never a case where nothing is coming up. It is like the final page is never rendered and nothing is returned to the browser.

Any ideas of what could be causing such behaviour?

I've tried this in two separate test machines with the same result.
Thanks

Comments

ronan’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

've done the backup and restore several times before with no problem with this very same site.
What could be the problem now?

What has changed about your site since the last time it worked?

ronan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Is this still an issue? If so please reopen.

jmussi’s picture

Version: 7.x-2.2 » 7.x-2.4
Status: Closed (cannot reproduce) » Active
StatusFileSize
new136.35 KB

After a long period and updating to version 2.4 of the backup module I tried this again, following these steps:
a) installed a local clean version of drupal 7.15
b) installed Backup and Migrate 2.4
c) created a manual backup from production system
d) dowloaded a copy of all production files and directories
e) loaded backup in my local version (got error show in attached file - expected since DB is not in synch with installed modules)
f) copied all production files and directories into local site
g) restore settings.php with local configuration
h) tried to access site and failed

The attached file shows the fatal error.

BTW, I noticed that the production DB has 45K entries while the restored local DB only 31K. I'm assuming that not all records are copied, is this correct? The total # of tables (200) matches in both DB

Any ideas?

ronan’s picture

Is the codebase the same between the production site and your local? You say you installed a clean 7.15, is that the version running on production? When you copy all files and directories do you mean user files (sites/default/files or whatever) or do you mean the whole thing (code and all)?

If you have access to phpMyAdmin or the mysql command line on your local, try the following:

1) Copy the code files etc. down to your local from production (you've already done this)
2) Grab a manual backup from production (you've done this too)
4) Create a new db locally (or drop all tables from the existing one, just make sure it's empty)
3) Restore that backup dump to local using phpMyAdmin (or mysql command line)
4) Edit local settings.php to point to the local db

This way you'll have an exact copy of your production site any you'll know if the issue is with the db backup or if there's an out of sync issue between code and db.

You are correct in your last point: B&M does not backup the contents of your cache tables, search index or watchdog table to save space.

ronan’s picture

Status: Active » Postponed (maintainer needs more info)
jmussi’s picture

Hi Ronan,

Thanks for the reply.
To answer your questions:
a) yes, the code base is the same - I copied all files from pdouctoin
b) yes, 7.15 is the version used in production
c) All files, not just the user specific

I actually tried the phpMyAdmin export/import but ran into the maximum execution time problem.
I'm new to mySql, so how do I import the "export.sq"l using mysql? Is it just mysql -u -p
<"export.sql"?

Thanks again for your help. I will let you know if this works. If ok, does it mean that "backup and migrate" will not work for this type of scenario?

Jose Mussi

ronan’s picture

Your command seems to be missing the database to work on. It'd be more like:

mysql -u[username] -p [dbname] < 'export.sql'

or just launch the mysql command line (with your username/password) and then run

> use dbname;
> \. /path/to/export.sql

I hope this helps

Ronan

jmussi’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Active

It worked! The local copy is up and running fine now.

So it seems that the problem is that the "backup and restore" is not copying over all the necessary data.
Is this something that will be resolved?
This got me worried since this is the only way I'm backing up my data right now and it seems that in case of a problem I won't be able to recover my site.
Should I start using a full DB backup from now on?

Please advise.

JM

ronan’s picture

Status: Active » Postponed (maintainer needs more info)

I don't know what series of events got your local db into the state it was in, but I suspect simply clearing it out and reimporting is all that was needed. B&M does not delete tables on restore, so if the versions of Drupal are a little out of whack, or if you've done stuff in the db before restoring there could be stuff missing. In this case, there also seemed to be an issue with your autoload class registry which is a whole world of hurt all by itself.

I'm not sure what you mean by: "Should I start using a full DB backup from now on?" What are you doing now?

jmussi’s picture

I use the "Backup and Migrate" to create the backup files on a daily basis, not a full export using mysql or phpMyAdmin.

The concern is that when I tried to recover using those files, the site does not come back completely.
I always started with a clean local database, expecting that all necessary file records will be recovered.
As described previously, all 200 DB files are recreated, but many records are missing.
The error I was getting seem to relate to the og module which is active in our site.

My concern is if I have a DB crash today and have to rebuild my site, all I have are those extracts created by "Backup and Migrate" and I have not been able to restore using them. I now know that if I create a full backup (all records), I can rebuild the site, but the same is not true with the files I have today.

Could it be that "Backup and Migrate" is missing some key records when creating the extract and this is causing the problem?

BTW, I'm not sure what the auto load class registry is...

Thanks for your assistance.

ronan’s picture

The only records B&M should be excluding should be cache tables, watchdog entries, search index records. All stuff you can recover a site without. If other tables are being excluded then you should check your Advanced Backup settings to make sure they weren't excluded by accident. If the settings look fine and your B&M backups are still not working then you should definitely have another backup running.

You indicated in comment #8 that your B&M backup did restore properly when you used the command like mysql, but you may have been using a phpMyAdmin export. If it did work, then the backups are probably fine and it was the restore that wasn't working, that may not be a big deal, since if you have a DB crash you won't have a running instance of Drupal to run the B&M restore anyway and will have to use the command line or phpMyAdmin.

jmussi’s picture

Category: bug » support

So the problem could be that I don't understand the exact steps to rebuild a site from the B&R files.
I've tried the following:

a) create a new instance of Drupal, using the same version of the system that is used in the production site
b) install the B&R module, and recover from the latest version of the B&R files
c) copy over all the user files from the production system

This is what I tried originally and caused the error files that I sent in posting #3.

Now I tried something different:

1) copied all files from the production system backup
2) create an empty DB
3) used mysql to load the latest version of the B&R files

In this case, when I access the site, Drupal thinks that this is a new site and goes into the standard setup screen
Obviously the B&R export did not include all configuration data and Drupal is confused.

So, what should be the right order of recovery here?
I have all the production files which include the B&R exports.
How do I build a new copy of the site from these files?

Thanks

ronan’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (works as designed)

It's been a while so I'm guessing you figured it out or moved on. Reopen if you still need help