/[drupal]/contributions/modules/provision/platform/migrate.provision.inc
ViewVC logotype

Contents of /contributions/modules/provision/platform/migrate.provision.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.15 - (show annotations) (download) (as text)
Sat Oct 24 05:43:40 2009 UTC (4 weeks, 5 days ago) by anarcat
Branch: MAIN
Changes since 1.14: +1 -1 lines
File MIME type: text/x-php
Revert "workaround for #485646 - pass the commandline arguments for the DB to deploy so we can force the database server manually"

This makes the *master* password show up on the commandline. Bad. We'll need to find another way.

This reverts commit 0eb09b06887129160ac0ea5ac555e35c45cb8d46.
1 <?php
2
3 /**
4 * Restore command implementation
5 *
6 * This command when called will
7 * 1. Make a backup of the current site, before modifications are made.
8 * 2. Temporarily disable the site by causing apache to redirect to a help page. Restarting apache is required.
9 * 3. Extract the backup that is being migrated to to a temporary folder in the sites directory.
10 * 4. Create a new database, belonging to the site's user, and switch it around with the current site's database.
11 * 5. Import the old database and site.php details.
12 * 6. Switch around the sites directory of the current site and the backup being migrated.
13 * 7. Regenerate configuration files.
14 * 8. TODO: diagnostic to test that everything is ok?
15 * 9. Remove the temporary redirect and restart apache so the previous site is available again.
16 * 10. Remove the extranuous db and duplicate site directory.
17 *
18 * If at any time an error occurs, before step 9. It should reverse all the changes it has made,
19 * and leave the current site directory and database in the right place, and remove all cruft that
20 * was created by this process.
21 */
22
23 /**
24 * Make sure we have a valid site being migrated, and that the file being migrated from exists
25 */
26 function drush_provision_drupal_provision_migrate_validate($url = null, $platform = null) {
27 drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
28 }
29
30 /**
31 * Make a backup before making any changes, and add extract the file we are restoring from
32 */
33 function drush_provision_drupal_pre_provision_migrate($url, $platform) {
34 drush_invoke('provision backup', $url);
35 }
36
37 /**
38 * Remove the extracted site directory
39 * Restore the vhost conf per the original platform
40 */
41 function drush_provision_drupal_pre_provision_migrate_rollback($url, $platform) {
42 $success = provision_path("unlink", drush_get_option('backup_file'), TRUE, dt('Removed unused migration site package'), dt('Could not remove unused migration site package'));
43 _provision_apache_create_vhost_config($url);
44 }
45
46 /**
47 * Switch the migrate directories around now that we have the new db installed
48 */
49 function drush_provision_drupal_provision_migrate($url, $platform) {
50 drush_backend_invoke('provision deploy', array($url, drush_get_option('backup_file'), 'root' => $platform,
51 'web_host' => drush_get_option('web_host'), 'web_ip' => drush_get_option('web_ip'),
52 'db_host' => drush_get_option('db_host')));
53 }
54
55
56 /**
57 * Delete the old site directory and recreate the settings file
58 */
59 function drush_provision_drupal_post_provision_migrate($url) {
60 drush_set_option('installed', FALSE);
61 _provision_drupal_delete_aliases(drush_get_option('aliases', array()));
62 _provision_recursive_delete(drush_get_option('sites_path') ."/$url");
63 }
64
65

  ViewVC Help
Powered by ViewVC 1.1.2