BackupBuddy: ImportBuddy

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
{{#ev:vimeo|59948891|400|right}}
+
'''ImportBuddy''' (importbuddy.php) is the tool that allows you to [[BackupBuddy:_Migrations|migrate]] or [[BackupBuddy:_Restore|restore]] a site with BackupBuddy. Keep a copy of the ImportBuddy script with your backups for restoring sites directly from backups.  
{{#ev:vimeo|59949774|400|right}}
+
==Getting Started==
+
===Getting the ImportBuddy tool===
+
The ImportBuddy tool can be downloaded in BackupBuddy.
+
  
# Navigate to the `Backup & Restore` page.
+
<br />
# Click on the `ImportBuddy` link or `Restore / Migrate` button depending on your version.
+
 
#* Alternatively you may click the `Send` link beneath the `Restore / Migrate` button to directly send the tool to a remote destination.
+
=ImportBuddy Password=
# Save the script to your computer. (You will next upload this script to your destination server to begin using it)
+
 
 +
To use ImportBuddy, you'll first need to set a password.  ImportBuddy requires this to protect unauthorized access to your site and backup files before you have finished restoring.
 +
 
 +
* This password is encoded inside your <code>importbuddy.php</code> file when it is made, so:
 +
** If you share this <code>importbuddy.php</code> file to another for usage with a backup file you will need to provide the corresponding password.
 +
** If you change the password will need to download a new copy of <code>importbuddy.php</code>. Changing the password will NOT change it in existing <code>importbuddy.php</code> files.
 +
 
 +
 
 +
#To set your password, navigate to '''BackupBuddy > Settings''' and enter the password you'd like to use in the [[BackupBuddy_Settings:_General#ImportBuddy_.26_RepairBuddy_password|ImportBuddy & RepairBuddy password]] section.<br /><br /><br />[[File:IBPassword.png|IBPassword.png|link=]]<br /><br /><br />
 +
#You can also set a password when you [[#Download|download ImportBuddy]]. If you set a password when downloading ImportBuddy, it overrides the password you created in your BackupBuddy Settings.  If you leave the option blank, it will use the default password you created in your settings.<br /><br /><br />[[File:ImportBuddyDownloadPassword.png|ImportBuddyDownloadPassword.png|link=]]<br /><br /><br />
 +
#An ImportBuddy password can also be set during the [[BackupBuddy:_Quick_Setup#2._Create_a_password_for_restoring_or_migrating_your_backups|Quick Setup]] page after first installing BackupBuddy.
 +
 
 +
<br />
 +
 
 +
=Accessing ImportBuddy=
 +
 
 +
After setting your ImportBuddy password, there are two ways you can access ImportBuddy:
 +
 
 +
*Manually downloading (and then uploading to destination server)
 +
*Sending to destination from within BackupBuddy
 +
 
 +
<br />
 +
 
 +
==Manually Downloading and Uploading to Destination Server==
 +
 
 +
To manually download ImportBuddy and upload to your destination server, follow these steps:
 +
 
 +
<br />
 +
 
 +
===Manually Downloading ImportBuddy===
 +
 
 +
<br />
 +
 
 +
#To download ImportBuddy, navigate to the '''Restore/Migrate''' page in BackupBuddy and click the '''Download ImportBuddy''' button. This will initiate the download of the ImportBuddy file.<br /><br /><br />[[File:DownloadImportBuddy.png|DownloadImportBuddy.png|link=]]<br /><br /><br />
 +
#Save the file to your computer.  
 +
#You will next [[BackupBuddy:_ImportBuddy_Rough_Draft#Uploading_ImportBuddy_to_your_destination_server|upload the ImportBuddy file to your destination server]] to begin using it.
 +
 
 +
<br />
  
 
===Uploading ImportBuddy to your destination server===
 
===Uploading ImportBuddy to your destination server===
* Decide on the FTP directory that you would like to migrate or restore the backup to (using an empty directory is best) that corresponds to the web URL you want your destination site to be at.
 
** For example, if you want your new site's URL to be "http://your.com/mybuddy/" then your server directory MIGHT be something like this "/usr/skyler/public_html/mybuddy/"; this is the directory you will then put importbuddy.php into. The directory structure varies host to host but often follows a similar format.
 
* Upload importbuddy.php and the backup zip file (don't rename the zip file!) to that FTP directory that corresponds to the URL you want.
 
* Navigate to the importbuddy.php file in your web browser after it has been uploaded.
 
** Example: <nowiki>http://newsite.com/importbuddy.php</nowiki>
 
* Follow the directions provided for each ImportBuddy step.
 
* If you encounter problems note the logging information displayed on the problem step when contacting support.
 
  
==Accessing the ImportBuddy tool==
+
<br />
 +
 
 +
#Decide on the FTP directory that you would like to migrate or restore the backup to (using an empty directory is best) that corresponds to the web URL you want your destination site to be at. For example, if you want your new site's URL to be "http://your.com/mybuddy/" then your server directory MIGHT be something like <code> /user/yourusername/public_html/mybuddy/</code>. This is the directory you will then put importbuddy.php into. '''Note:''' The directory structure varies host to host but often follows a similar format.
 +
#Upload <code>importbuddy.php</code> and your backup zip file to the FTP directory that corresponds to your desired URL.
 +
#Navigate to the <code>importbuddy.php</code> file in your web browser after it has been uploaded. '''Example:''' <code><nowiki>http://newsite.com/importbuddy.php</nowiki></code>
 +
#To complete the migration or restoration process, visit the [[BackupBuddy:_Manual_Migration|Manual Migration]] page.
 +
 
 +
<br />
 +
 
 +
<br />
 +
 
 +
==Sending ImportBuddy to Destination==
 +
 
 +
Instead of manually downloading ImportBuddy, you can send ImportBuddy directly to the location of your migration/restoration from within BackupBuddy.
 +
 
 +
<br />
 +
 
 +
#To send ImportBuddy to a destination, navigate to the '''Restore/Migrate''' page in BackupBuddy and click the '''Send ImportBuddy to a Destination'''.<br /><br /><br />[[File:ImportBuddySendtoDestination.png|ImportBuddySendtoDestination.png|link=]]<br /><br /><br />
 +
#In the window that opens, you be given options for where to send the ImportBuddy file. You'll find a list of your current remote destinations and an option to create a new destination.<br /><br /><br />[[File:ImportBuddyDestinationOptions.png|ImportBuddyDestinationOptions.png|link=]]<br /><br /><br />
 +
#Follow the steps for [[BackupBuddy:_Manual_Migration|Manual Migration]].
 +
 
 +
<br />
 +
 
 +
=The 6 ImportBuddy Steps=
  
In your web browser go to the URL corresponding to the FTP directory you uploaded to. For example, if you uploaded importbuddy.php to /usr/skyler/public_html/undiscoveredcorner/importbuddy.php then your ImportBuddy URL MIGHT be http://your.com/undiscoveredcorner/importbuddy.php
+
For more information on the ImportBuddy migration/restore process, visit the following links:
Upon going to this URL you will be prompted to log in to begin the import / restore process.  Follow the on-screen directions.
+
  
==Log In - Password Authentication==
+
*[[BackupBuddy:_Manual_Migration#The_6_ImportBuddy_Steps_for_Manual_Migrations|The 6 ImportBuddy Steps for Manual Migrations]]
 +
*[[BackupBuddy:_Magic_Migration#The_6_ImportBuddy_Steps_for_Magic_Migrations|The 6 ImportBuddy Steps for Magic Migrations]]
  
This step asks for the password associated with the importbuddy.php file. ImportBuddy requires this to protect unauthorized access to your site and backup files before you have finished restoring. This password was previously set by you (or someone) on BackupBuddy's Settings page.
+
<br />
  
''Typical Usage''
+
=Advanced Options=
* Enter your password.
+
ImportBuddy's '''Advanced Options''' allow customization of various ImportBuddy functionality for custom purposes or troubleshooting. '''Exercise caution as some advanced options may have unforeseen effects if not used properly, such as overwriting existing files or erasing existing database content.'''
* Submit the form to continue. (Click the button to submit / continue to the next step)
+
  
Misc Notes:
+
Advanced Options can be located after clicking the '''Advanced Options''' button during Step 1 and 4 the [[BackupBuddy:_ImportBuddy_Rough_Draft#The_6_ImportBuddy_Steps|6 ImportBuddy Steps]].
* The password is encoded inside your importbuddy.php file when it is made, so:
+
** If you share this importbuddy.php file to another for usage with a backup file you will need to provide the corresponding password.
+
** If you change the password will need to download a new copy of importbuddy.php; changing the password will NOT change it in existing importbuddy.php files.
+
  
 +
<br />
  
==Step 1==
+
[[File:Step1-advanced-options.png|link=]]
NOTE: You DO NOT need to first install WordPress on the target hosting server.
+
  
On this step a listing of backup files that were found in the same directory as the importbuddy.php script are listed for your selection to restore / migrate. If you have not already uploaded your backup file along with the importbuddy.php file an upload feature is available for convenience. However, ''FTP is the best way to upload your backup archives (.zip files), especially for larger files.''.
+
<br />
  
''Typical Usage''
+
'''Step 1 Advanced Options:'''
* Select the backup you want to restore or migrate to this destination.
+
* Select any optional advanced options if needed or directed by technical support.
+
* Submit the form to continue.
+
  
===Advanced Troubleshooting Options===
+
*'''ZIP Archive Extraction (Step 2)'''
ImportBuddy automatically accounts for many server configurations and troubleshooting settingsHowever, when ImportBuddy cannot automatically account for some difficulty or cannot automatically assume to do so safely, you have the option to control server options and features which can aid with working around server problems or troubleshooting possible issues.
+
**'''Skip zip file extraction''' - Checking this box will prevent extraction/unzipping of the backup ZIP fileYou will need to manually extract it either on your local computer then upload it or use a server-based tool such as cPanel to extract it. This feature is useful if the extraction step is unable to complete for some reason.
 +
**'''Force medium speed compatibility mode (ZipArchive)''' - Bypass attempting to use command line zip. Rarely needed; troubleshooting.
 +
**'''Force slow speed compatibility mode (PCLZip)''' - Bypass both high speed mode and medium speed mode, falling back all the way to PCLZip (slow speed). Rarely needed; troubleshooting.
  
''Features''
+
*'''Database Import & Migration (Steps 3-5)'''
* Skip zip file extraction.
+
**Select the "Adanced Options" button while on Step 3 for database options.
** If enabled then Step 2 of ImportBuddy will skip unzipping / extracting your backup ZIP file. You will need to manually unzip the file somehow, such as on your local system and then uploading all files, or with a server-side tool such as within your host's control panel file manager (if available).
+
* Wipe all database tables. - Use caution.
+
** This features wipes (erases / deletes) ALL tables within the database you will later select. Use extreme caution with this feature as it could release in permanent loss of data / sites / content in your database if used improperly. This is typically used to clear out a database and start fresh for this restored site. - Use caution.
+
* Wipe only database tables matching prefix.
+
** This feature is like the above EXCEPT it only erases tables with the same prefix you enter.  Ie if you enter wp_ only tables starting with wp_ will be erased. Use caution.  This is typically used to overwrite a single existing site.
+
* Skip import of database.
+
** Useful if you only want to restore files and not import anything into your current database. Note: Your database will still be migrated unless disabled below.
+
* Skip migration of database.
+
** Useful if you only want to migrate the data in the already imported database (ie: You already imported a database or have an existing one and just need things like URLs and paths migrated.) Note: Your database will still be imported unless disabled above.
+
* Error Logging to importbuddy.txt
+
* Ignore SQL errors & hide them. Rarely used option for hiding error messages. This can be used if your server is reporting incorrect errors/warnings caused by misconfiguration and it's preventing you from continuing the restore.
+
* Skip migration of .htaccess file.
+
** Rarely used for technical purposes only.
+
* Force medium speed compatibility mode (ZipArchive).
+
** Bypass attempting to use command line zip. Rarely needed; troubleshooting.
+
* Force slow speed compatibility mode (PCLZip).
+
** Bypass both high speed mode and medium speed mode, falling back all the way to PCLZip (slow speed). Rarely needed; troubleshooting.
+
* Show detailed PHP warnings.
+
* PHP Maximum Execution Time
+
** Setting this a little lower can help force importbuddy to chunk the importing and migration of the database into multiple steps if large
+
  
==Step 2==
+
*'''General'''
The file extraction process occurs during this step. ImportBuddy attempts to unzip / extract your backup ZIP archive (.zip file) into the same directory as the importbuddy.php script.
+
**'''Skip migration of .htaccess file''' - Rarely used; for technical purposes only.
 +
**'''Show detailed PHP warnings'''
  
ImportBuddy attempts to use the following techniques to unzip on your server:
+
*'''Import Logging''' - Errors and other debugging information will be written to importbuddy.txt in the same directory as importbuddy.php.  This is useful for debugging any problems encountered during import.  Support may request this file to aid in tracking down any problems or bugs.
* Command line zip on both Linux and Windows systems (if zip.exe is provided and properly granted security access to run). (Very fast and reliable) - BEST
+
* PHP's ZipArchive library. (decent speed; reliable) - MEDIUM LEVEL
+
* PCLZip (extracts the zip file using a PHP script; very low performance; relies on PHP memory limits which are commonly low) - WORST CASE
+
  
'''If you are having difficulties getting past this step it is often simplest to just manually unzip your site locally on your computer and upload the files to the destination directory by FTP (or using cpanel to unzip) and on Step 1 of ImportBuddy, select the 'Advanced troubleshooting option' to `Skip file extraction`.'''  See the frequently seen support questions page if you want to troubleshoot why the unzip is failing.
+
<br />
  
==Step 3==
+
[[File:Screen Shot 2013-08-13 at 12.33.03 PM.png|link=]]
This step is used to set the URL and database connection information. The information shown in parentheses is what importbuddy sees the values where previously, useful for a restore when most if not all of the information will be the same.
+
* WordPress Address
+
** This field will be pre-set using the information for the current directory the user is restoring/migrating to.
+
* MySQL Server
+
** This is the address to the mySQL server where your database will be stored. 99% of the time this is localhost.  The location of your mySQL server will be provided to you by your host if it differs.
+
* Database Name
+
** This is the name of the database you want to import your blog into. The database user must have permissions to be able to access this database.  If you are migrating this blog to a new host you will need to create this database (ie using CPanel or phpmyadmin) and create a mysql database user with permissions.
+
* Database User
+
** This is the database user account that has permission to access the database name in the input above.  This user must be given permission to this database for the import to work.
+
* Database Pass
+
** This is the password for the database user.
+
* Database Prefix
+
** This is the prefix given to all tables in the database.  If you are cloning the site on the same server AND the same database name then you will want to change this or else the imported database will overwrite the existing tables.
+
** The most common prefix is wp_ which is fine to use but if you want to use something else that is fine.
+
After entering the database information there is a button labelled "test database settings" that will test the validity of that connection information.
+
  
==Step 4==
+
<br />
The database information is imported straight into the database. Your database with any old URLs / paths from the source server exist temporarily on the destination server. The next step will update this data in the database.
+
  
 +
'''Step 4 Advanced Options''':
  
==Step 5==
+
*'''Database Import (Step 4)'''
If your destination URL and/or file paths need to be updating due to using a new site URL or server directory stucture then ImportBuddy will proceed to migrate various data inside your database. Importbuddy searches through the database and updates any URLs, paths, settings, etc. that match your source site's settings (BackupBuddy recorded these settings for you in the backup for this functionality to work). The wp-config.php information (such as any new database settings) is set.
+
**'''Skip import of database'''
* Use the link of the site provided to verify that the site is fully migrated and complete before continuing to step 6.
+
**'''Delete database tables that match new prefix on import''' - WARNING: Checking this box will have this script clear ALL existing data from your database that match the new database prefix prior to import, possibly including non-WordPress data. This is useful if you are restoring over an existing site or repairing a failed migration. Use caution when using this option and double check the destination prefix. This cannot be undone.
* Can choose which of the import files get deleted in next step if desired. By default is all of them.
+
**'''Delete ALL database tables, erasing ALL database content''' - WARNING: Checking this box will have this script clear ALL existing data from your database, period, including non-WordPress data found. Use with extreme caution, verifying you are using the exact correct database settings. This cannot be undone.
 +
**'''Force database import compatibility (pre-v3.0) mode'''
 +
**'''Ignore existing WordPress tables and import (merge tables) anyways''' -  When checked ImportBuddy will allow importing database tables that have the same name as existing tables. This results in a merge of the existing data with the imported database being merged. Note that this is does NOT update existing data and only ADDS new database table rows. All other SQL conflict errors will be suppressed as well. Use this feature with caution.
  
 +
*'''Maximum time allowed per import chunk'''
  
==Step 6==
+
*'''Database Migration (Step 5)'''
Cleanup step. This step attempts to delete any temporary files created by ImportBuddy or uploaded by you. If your restore is fully complete you can delete all of these files (assuming you have your backup zip stored elsewhere). Leaving these files could potentially be a security risk. If ImportBuddy is unable to delete these files please use your FTP client or web host's file management tools to delete them.
+
**'''Skip all migration of URLs/paths in database''' - Skip extended brute force migration of URLS/paths in database.
* Backup zip archive (.zip file)
+
**'''Skip extended brute force migration of URLS/paths in database''' - By default BackupBuddy will extensively examine and migrate unknown database tables. Sometimes however this can cause timeouts on larger sites. You may skip this intensive procedure to reduce required runtime for database migration steps. Note that some URLs or paths may not be updated if skipping this step. All major WordPress URLs and paths will still be updated however.
* ImportBuddy Tool - importbuddy.php file (the tool you are using right now)
+
* Any temporary import files (db_1.sql, backupbuddy_dat.php, etc.)
+
* importbuddy-XXXXXXX.txt log file
+
  
 +
=See also=
 +
*[[BackupBuddy_Restore/Migrate:_Introduction|Introduction]]
 +
*ImportBuddy
 +
*[[BackupBuddy:_Migrations|Migrations]]
 +
**[[BackupBuddy:_Manual_Migration|Manual Migration]]
 +
**[[BackupBuddy:_Magic_Migration|Magic Migration]]
 +
*[[BackupBuddy:_Restore|Restore]]
 +
**[[BackupBuddy:_View_and_Restore_Individual_Files|Individual File View & Restore]]
  
[[Category:PluginBuddy]]
+
<br />
 +
[[:BackupBuddy_Test|← Back to BackupBuddy Codex Home]]

Revision as of 15:21, August 13, 2013

ImportBuddy (importbuddy.php) is the tool that allows you to migrate or restore a site with BackupBuddy. Keep a copy of the ImportBuddy script with your backups for restoring sites directly from backups.


Contents

ImportBuddy Password

To use ImportBuddy, you'll first need to set a password. ImportBuddy requires this to protect unauthorized access to your site and backup files before you have finished restoring.

  • This password is encoded inside your importbuddy.php file when it is made, so:
    • If you share this importbuddy.php file to another for usage with a backup file you will need to provide the corresponding password.
    • If you change the password will need to download a new copy of importbuddy.php. Changing the password will NOT change it in existing importbuddy.php files.


  1. To set your password, navigate to BackupBuddy > Settings and enter the password you'd like to use in the ImportBuddy & RepairBuddy password section.


    IBPassword.png


  2. You can also set a password when you download ImportBuddy. If you set a password when downloading ImportBuddy, it overrides the password you created in your BackupBuddy Settings. If you leave the option blank, it will use the default password you created in your settings.


    ImportBuddyDownloadPassword.png


  3. An ImportBuddy password can also be set during the Quick Setup page after first installing BackupBuddy.


Accessing ImportBuddy

After setting your ImportBuddy password, there are two ways you can access ImportBuddy:

  • Manually downloading (and then uploading to destination server)
  • Sending to destination from within BackupBuddy


Manually Downloading and Uploading to Destination Server

To manually download ImportBuddy and upload to your destination server, follow these steps:


Manually Downloading ImportBuddy


  1. To download ImportBuddy, navigate to the Restore/Migrate page in BackupBuddy and click the Download ImportBuddy button. This will initiate the download of the ImportBuddy file.


    DownloadImportBuddy.png


  2. Save the file to your computer.
  3. You will next upload the ImportBuddy file to your destination server to begin using it.


Uploading ImportBuddy to your destination server


  1. Decide on the FTP directory that you would like to migrate or restore the backup to (using an empty directory is best) that corresponds to the web URL you want your destination site to be at. For example, if you want your new site's URL to be "http://your.com/mybuddy/" then your server directory MIGHT be something like /user/yourusername/public_html/mybuddy/. This is the directory you will then put importbuddy.php into. Note: The directory structure varies host to host but often follows a similar format.
  2. Upload importbuddy.php and your backup zip file to the FTP directory that corresponds to your desired URL.
  3. Navigate to the importbuddy.php file in your web browser after it has been uploaded. Example: http://newsite.com/importbuddy.php
  4. To complete the migration or restoration process, visit the Manual Migration page.



Sending ImportBuddy to Destination

Instead of manually downloading ImportBuddy, you can send ImportBuddy directly to the location of your migration/restoration from within BackupBuddy.


  1. To send ImportBuddy to a destination, navigate to the Restore/Migrate page in BackupBuddy and click the Send ImportBuddy to a Destination.


    ImportBuddySendtoDestination.png


  2. In the window that opens, you be given options for where to send the ImportBuddy file. You'll find a list of your current remote destinations and an option to create a new destination.


    ImportBuddyDestinationOptions.png


  3. Follow the steps for Manual Migration.


The 6 ImportBuddy Steps

For more information on the ImportBuddy migration/restore process, visit the following links:


Advanced Options

ImportBuddy's Advanced Options allow customization of various ImportBuddy functionality for custom purposes or troubleshooting. Exercise caution as some advanced options may have unforeseen effects if not used properly, such as overwriting existing files or erasing existing database content.

Advanced Options can be located after clicking the Advanced Options button during Step 1 and 4 the 6 ImportBuddy Steps.


Step1-advanced-options.png


Step 1 Advanced Options:

  • ZIP Archive Extraction (Step 2)
    • Skip zip file extraction - Checking this box will prevent extraction/unzipping of the backup ZIP file. You will need to manually extract it either on your local computer then upload it or use a server-based tool such as cPanel to extract it. This feature is useful if the extraction step is unable to complete for some reason.
    • Force medium speed compatibility mode (ZipArchive) - Bypass attempting to use command line zip. Rarely needed; troubleshooting.
    • Force slow speed compatibility mode (PCLZip) - Bypass both high speed mode and medium speed mode, falling back all the way to PCLZip (slow speed). Rarely needed; troubleshooting.
  • Database Import & Migration (Steps 3-5)
    • Select the "Adanced Options" button while on Step 3 for database options.
  • General
    • Skip migration of .htaccess file - Rarely used; for technical purposes only.
    • Show detailed PHP warnings
  • Import Logging - Errors and other debugging information will be written to importbuddy.txt in the same directory as importbuddy.php. This is useful for debugging any problems encountered during import. Support may request this file to aid in tracking down any problems or bugs.


Screen Shot 2013-08-13 at 12.33.03 PM.png


Step 4 Advanced Options:

  • Database Import (Step 4)
    • Skip import of database
    • Delete database tables that match new prefix on import - WARNING: Checking this box will have this script clear ALL existing data from your database that match the new database prefix prior to import, possibly including non-WordPress data. This is useful if you are restoring over an existing site or repairing a failed migration. Use caution when using this option and double check the destination prefix. This cannot be undone.
    • Delete ALL database tables, erasing ALL database content - WARNING: Checking this box will have this script clear ALL existing data from your database, period, including non-WordPress data found. Use with extreme caution, verifying you are using the exact correct database settings. This cannot be undone.
    • Force database import compatibility (pre-v3.0) mode
    • Ignore existing WordPress tables and import (merge tables) anyways - When checked ImportBuddy will allow importing database tables that have the same name as existing tables. This results in a merge of the existing data with the imported database being merged. Note that this is does NOT update existing data and only ADDS new database table rows. All other SQL conflict errors will be suppressed as well. Use this feature with caution.
  • Maximum time allowed per import chunk
  • Database Migration (Step 5)
    • Skip all migration of URLs/paths in database - Skip extended brute force migration of URLS/paths in database.
    • Skip extended brute force migration of URLS/paths in database - By default BackupBuddy will extensively examine and migrate unknown database tables. Sometimes however this can cause timeouts on larger sites. You may skip this intensive procedure to reduce required runtime for database migration steps. Note that some URLs or paths may not be updated if skipping this step. All major WordPress URLs and paths will still be updated however.

See also


← Back to BackupBuddy Codex Home

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox