# Using Backup and Migrate Module to download windows compatible backup

I have created a Drupal7 based web-site on my hosting server. I have made changes to the themes, created views and done other customizations. I would like to create a duplicate copy of the site on my local laptop, so that I can test my changes locally before making them live on the site. I installed the Backup and Migrate module on my host server and downloaded a backup of the entire site to my windows 7 laptop. I already have a WAMP installation and all required services running for creating drupal7 site.

The file I downloaded looks like a tar ball of the entire drupal folder and the DB and the size is 106 MB. Since, it is a tar ball I could not open the existing file in windows. My questions:

1. Is there a way to get around the tar ball? I tried specifying zip as the compression format, but that did not help. I do not see any option to specify no tar.
2. What is the correct way to create a copy of the site locally, considering I have made changes not only to DB, but other files too. I have seen other options such as exporting the DB and FTPing the sites folder. If I were to do this, how do I FTP the sites folder to my windows laptop?

Thanks

There's a couple steps you still need to do:

1. To "untar" the tar ball on Windows, you just need the right software for it. An easy to use and free software that supports TONS of compression types is 7-Zip -- http://www.filehippo.com/download_7-zip_64.

2. Once you have all the files available to you, you'll need to import the database into MySQL. Luckily WampServer comes with phpMyAdmin. You can find a link to it in the tray icon for WampServer. First create your database, then use the Import tab to load in the SQL file.

3. Modify the settings.php file to match the database database connection information for your local MySQL installation. The default installation of Drupal creates this file is at /sites/default/settings.php.

4. Then visit http:// my-local-host/ (or http:// my-local-host/[my-drupal-subdirectory]/) to see if it's working. (Replace "my-local-host" with "localhost" since StackExchange doesn't like "localhost" in a link).

• Thanks for the answer. When I create my database and import the sql file, I get an error saying column too long, use row_format=dynamic or compression. Is there a workaround to overcome this. – cppcoder Oct 2 '14 at 17:53
• I've been using MySQL for many years on many different hosts and never had that problem, so it sounds to me like a configuration setting on your remote server which is different than your local server. If you can get access to phpMyAdmin on your remote server, you can manually export to a file (don't forget to set the compression) and then try importing that locally. Otherwise, you might try changing your local MySQL server settings per the answer here: stackoverflow.com/questions/24321896/… – hargobind Oct 3 '14 at 7:10

I believe PHP supports output streams in gzip, tar, zip -- you simply need the correct PHP extension installed/enabled in your php environment. To my knowledge Backup and Migrate will make use of the available options in your configuration.

In the 2.x branch, zip is an allowed filter: http://cgit.drupalcode.org/backup_migrate/tree/includes/filters.compression.inc#n77

You can see what your php configuration is easily on a system using php_info() on the command line or looking at admin/status/reports in the drupal administration area under the PHP report.

What is the correct way to create a copy of the site locally, considering I have made changes not only to DB, but other files too. I have seen other options such as exporting the DB and FTPing the sites folder. If I were to do this, how do I FTP the sites folder to my windows laptop?

Backup and Migrate (BAM) is a fine way to backup a full drupal site. It has many contributed addon modules to backup to other destinations, such as Dropbox if needed. An additional option to BAM is Drush and the archive-dump command which gives you a .tar.gz (hehe) of an archive-manifest of your full site. You can the easily restore the site via commandline using drush archive-restore /path/to/dump.tar.gz .... see drush help archive-restore for full documentation examples.

I'm sorry I can't answer your question how to use FTP, this is a drupal only forum and general programming question should be resolved via Google or StackOverflow for instance.

• I found a software called 7-zip which helped me to untar and extract the tar ball. I'm trying to create a new test site and will let you guys know how it goes. Btw, I have been hearing about drush - will it provide a linux like command line in windows. – cppcoder Oct 1 '14 at 22:08
• i hear google is great at answering how to use drush. as is the github drush page. – tenken Oct 1 '14 at 22:17