Attempting to import and existing drupal-6.10 site to aegir following the directions in this post: http://groups.drupal.org/node/24992 (Using option B)
Step 1: Transfer the Codebase:
I've successfully transferred the Codebase (I think!)
Step 2: Transfer the Database:
According to the directions, I should create a new database for the imported site and import the .sql file from the site I am importing, and then create a user, using the same username from the old site and grant appropriate permissions.
Should I also name the database the same as on the old MySQL server? Or does it not matter...? My question, I guess, relates to the database settings in settings.php for the site...does that need to be modified, too??? Now that the site is on my server, wouldn't it still be accessing the old database?
I think I follow along with the rest of the directions, but this confuses me...please forgive my ignorance. Perhaps I'm overthinking this, or just don't understand aegir well enough at the point to know what's going on behind the scenes.
Thanks for your help!
Comments
I've completed the database
I've completed the database recreation and moved on to aegir platform creation; the platform verifies, and it sees the site, but the import fails with database errors (as I expected it would...). Here is the error(s):
NOTE: Items in BOLD, below, were changed by me for security purposes!
Drush bootstrap phase : _drush_bootstrap_drupal_configuration()
SQLSTATE[00000] [1130] Host '00.000.000.00' is not allowed to connect to this MySQL server
Drush was not able to start (bootstrap) the Drupal database. Hint: This err... (Expand)Drush was not able to start (bootstrap) the Drupal database. Hint: This error often occurs when Drush is trying to bootstrap a site that has not been installed or does not have a configured database. Drush was attempting to connect to : Drupal version : 6.10 Site URI : http://example.org Database driver : mysqli Database hostname : mysql.example.org Database username : username Database name : dbname Default theme : garland Administration theme: garland PHP configuration : /etc/php5/cli/php.ini Drush version : All-versions-3.0-rc4 Drush configuration: /var/aegir/drupal-6.10/drushrc.php Drupal root : /var/aegir/drupal-6.10 Site path : sites/example.org Modules path : sites/all/modules Themes path : sites/all/themes %paths : Array You can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line or $options['uri'] in your drushrc.php file.
An error occurred at function : drush_provision_drupal_provision_import
Command dispatch complete
Peak memory usage was 7.74 MB
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete
Peak memory usage was 18.84 MB
Now, the question is...how do I get around this??? I thought perhaps by changing the settings.php file in my /var/aegir/drupal-6.10/sites/example.org/settings.php file, but for security purposes, the database connection settings are not in that file, and I am wary of changing them elsewhere without knowing exactly what I'm doing...
Thanks in advance for your help!
Settings.php is the key
Settings.php has to have the correct database connection string for Aegir to import the site properly. Get settings.php as close to a stock Drupal install and you should be good to go with importing the site. The connection string in settings.php should point to the same database server that Aegir knows about (typically localhost). You also need to make sure the mysql user for the database has the correct permissions and access to the database from the host it will be connecting from (in mysql.user and mysql.db), typically also localhost. Later, if you migrate the site to another platform within Aegir, the database will be migrated to a new database name and database username (site_ID) and Aegir will take care of the permissions for that instance.
-Tim
Thanks for the help,
Thanks for the help, Tim...got all that straightened out, but now I've got this:
Loading drushrc "/var/aegir/drupal-6.10/drushrc.php" into "drupal" scope.
Initialized Drupal 6.10 root directory at /var/aegir/drupal-6.10
Found command: provision-import (commandfile=provision)
Initializing drush commandfile: drush_make
Initializing drush commandfile: drush_make_d_o
Initializing drush commandfile: provision
Initializing drush commandfile: provision_apache
Undefined index: base_url provision_apache.drush.inc:50
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_mysql
Undefined index: db_url provision_mysql.drush.inc:16
Including /var/aegir/.drush/provision/platform/import.provision.inc
Drush bootstrap phase : _drush_bootstrap_drupal_site()
Initialized Drupal site spiritofthe-children.org at sites/spiritofthe-children.org
Drush bootstrap phase : _drush_bootstrap_drupal_configuration()
Drush bootstrap phase : _drush_bootstrap_drupal_database()
Successfully connected to the Drupal database.
Drush bootstrap phase : _drush_bootstrap_drupal_full()
WD php: fopen(sites/spiritofthe-children.org/drushrc.php): failed to open stream: Permission denied in /var/aegir/drush/includes/context.inc on line 537.
Drushrc (sites/spiritofthe-children.org/drushrc.php) could not be written
Could not change permissions of drushrc.php to 384 (chmod to 600 failed on sites/spiritofthe-children.org/drushrc.php)
fopen(sites/spiritofthe-children.org/drushrc.php): failed to open stream: Permission denied in /var/aegir/drush/includes/context.inc on line 537.
Command dispatch complete
Peak memory usage was 26.57 MB
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete
Peak memory usage was 18.84 MB
Any suggestions?
Verify errors
Trying to resolve the above errors, I looked at my verify task and found this, which may be the cause of my problem, though I still don't know how to filx it...:-(
(Errors in BOLD)
Task starts processing
Running: /var/aegir/drush/drush.php --root='/var/aegir/platforms/drupal-6.10' provision-verify --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/var/aegir/platforms/drupal-6.10/drushrc.php" into "drupal" scope.
Initialized Drupal 6.10 root directory at /var/aegir/platforms/drupal-6.10
Found command: provision-verify (commandfile=provision)
Initializing drush commandfile: drush_make
Initializing drush commandfile: drush_make_d_o
Initializing drush commandfile: provision
Initializing drush commandfile: provision_apache
Undefined index: base_url provision_apache.drush.inc:50
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_mysql
Undefined index: db_url provision_mysql.drush.inc:16
Including /var/aegir/.drush/provision/web_server/verify.provision.inc
Including /var/aegir/.drush/provision/platform/backupmigrate/verify.provision.inc
Including /var/aegir/.drush/provision/platform/verify.provision.inc
Including /var/aegir/.drush/provision/db_server/verify.provision.inc
Including /var/aegir/.drush/provision/ssl/verify.provision.inc
Virtual host configuration path exists.
Virtual host configuration ownership of path has been changed to aegir.
Virtual host configuration permissions of path have been changed to 0700.
Virtual host configuration path is writable.
Platforms configuration path exists.
Platforms configuration ownership of path has been changed to aegir.
Platforms configuration permissions of path have been changed to 0700.
Platforms configuration path is writable.
file_get_contents(/var/aegir/platforms/drupal-6.10/.htaccess): failed to open stream: No such file or directory verify.provision.inc:83
Generating apache platform configuration file platform_85.conf.
Undefined variable: file provision_apache.drush.inc:219
Generating apache server configuration file .
Apache has been restarted
Provision configuration path exists.
Provision configuration ownership of path has been changed to aegir.
Provision configuration permissions of path have been changed to 0711.
Provision configuration path is writable.
Provision PHP configuration path exists.
Provision PHP configuration ownership of path has been changed to aegir.
Provision PHP configuration permissions of path have been changed to 0711.
Provision PHP configuration path is writable.
Global configuration file exists
Backup path exists.
Backup ownership of path has been changed to aegir.
Backup permissions of path have been changed to 0700.
Backup path is writable.
Drupal sites directory is writable by the provisioning script
This platform is running drupal 6.10
Found 92 modules in base
Found 7 themes in base
Found install profile default
Changed permissions of sites/all to 0755
Changed permissions of sites/all/themes to 2775
Changed permissions of sites/all/modules to 2775
Changed permissions of sites/all/libraries to 2775
Changed permissions of sites/all/private to 0755
Changed permissions of sites/all/private/files to 2770
Changed permissions of sites/all/private/temp to 2770
Mysql can create new databases.
Found existing drushrc.php file
Changed permissions of drushrc.php to 0600
Drushrc file (/var/aegir/platforms/drupal-6.10/drushrc.php) was written successfully
Changed permissions of drushrc.php to 0400
Command dispatch complete
Peak memory usage was 8.44 MB
WD php: Invalid argument supplied for foreach() in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.module on line 310.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
Invalid argument supplied for foreach() in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.module on line 310.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
Command dispatch complete
Peak memory usage was 20.73 MB
Missing .htaccess would not copy with wildcard command
Looks like the Drupal root .htaccess file is missing. If you copied the contents of the Drupal folder with a wildcard, it would not have gotten the .htaccess. Per mig5's post here: http://groups.drupal.org/node/63858#comment-188973
Try manually copying over the .htaccess file. You might need to start over with provisioning the platform or site or Aegir, not sure.
-Tim
Hmmm... root@hometowncauses:/
Hmmm...
root@hometowncauses:/var/aegir# find -name .htaccess
./hostmaster-0.4-alpha7/.htaccess
./hostmaster-0.4-alpha7/sites/aegir.hometowncauses.org/files/tmp/.htaccess
./hostmaster-0.4-alpha7/sites/aegir.hometowncauses.org/files/.htaccess
./platforms/drupal-6.10/sites/spiritofthe-children.org/files/.htaccess
./platforms/drupal-6.10/sites/spiritofthe-children.org/files/civicrm/upload/.htaccess
./platforms/drupal-6.16/.htaccess
root@hometowncauses:/var/aegir#
It seems that the .htaccess file is missing in ./platforms/drupal-6.10, but it is in the ./platforms/drupal-6.10/sites directory for the site I'm trying to import.
I just copied over the file from ./platforms/drupal-6.16 to ./platforms/drupal-6.10 and that error is gone, but I'm still getting all the others...
sh-3.2$ find /var/aegir -name .htaccess
/var/aegir/hostmaster-0.4-alpha7/.htaccess
/var/aegir/hostmaster-0.4-alpha7/sites/aegir.hometowncauses.org/files/tmp/.htaccess
/var/aegir/hostmaster-0.4-alpha7/sites/aegir.hometowncauses.org/files/.htaccess
/var/aegir/platforms/drupal-6.10/.htaccess
/var/aegir/platforms/drupal-6.10/sites/spiritofthe-children.org/files/.htaccess
/var/aegir/platforms/drupal-6.10/sites/spiritofthe-children.org/files/civicrm/upload/.htaccess
/var/aegir/platforms/drupal-6.16/.htaccess
Thanks so much, Tim!
Multiple .htaccess files is normal
I believe it is normal to have multiple .htaccess files throughout your Drupal folder structure and certainly one at the root of each platform. When you do a recursive copy with a wildcard:
cp -R drupal/* drupal2/It will miss the .htaccess file at the root of the source folder, but it will get all the other .htaccess files in sub-folders. (I think, cannot test ATM.)
So are you still getting errors due to the other .htaccess files?
Yes, still getting all these
Yes, still getting all these errors....are they related to this??? I can totally understand missing picking up the .htaccess file in my original tarball from the site, but I can't understand what these other errors are telling me...
WD php: Invalid argument supplied for foreach() in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.module on line 310.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
Invalid argument supplied for foreach() in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.module on line 310.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
Thanks again...you've been a real help...just knowing someone is listening is comforting. I'm really keen to get this particular site moved over...I'm not looking forward to having to go thru all the updates on the site as it stands, and would much prefer to move it over to Aegir to manage it going forward!
M
At this point...
I must defer to someone with more experience.
Thanks, Tim...I've submitted
Thanks, Tim...I've submitted this as a support request, but haven't heard anything...maybe I should try IRC.
I'm getting something similar to your last errors
Task starts processing
Running: /var/aegir/drush/drush.php --root='/var/aegir/platforms/hcd1' provision-import 'prototype.contractorwebsites.net' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/var/aegir/platforms/hcd1/drushrc.php" into "drupal" scope.
Initialized Drupal 6.16 root directory at /var/aegir/platforms/hcd1
Found command: provision-import (commandfile=provision)
Initializing drush commandfile: drush_make
Initializing drush commandfile: drush_make_d_o
Initializing drush commandfile: provision
Initializing drush commandfile: provision_apache
Undefined index: base_url provision_apache.drush.inc:50
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_mysql
Undefined index: db_url provision_mysql.drush.inc:16
Including /var/aegir/.drush/provision/platform/import.provision.inc
Drush bootstrap phase : _drush_bootstrap_drupal_site()
Initialized Drupal site prototype.contractorwebsites.net at sites/prototype.contractorwebsites.net
Drush bootstrap phase : _drush_bootstrap_drupal_configuration()
Drush bootstrap phase : _drush_bootstrap_drupal_database()
Successfully connected to the Drupal database.
Drush bootstrap phase : _drush_bootstrap_drupal_full()
WD php: fopen(sites/prototype.contractorwebsites.net/drushrc.php): failed to open stream: Permission denied in /var/aegir/drush/includes/context.inc on line 537.
Drushrc (sites/prototype.contractorwebsites.net/drushrc.php) could not be written
Could not change permissions of drushrc.php to 384 (chmod to 600 failed on sites/prototype.contractorwebsites.net/drushrc.php)
fopen(sites/prototype.contractorwebsites.net/drushrc.php): failed to open stream: Permission denied in /var/aegir/drush/includes/context.inc on line 537.
Command dispatch complete
Peak memory usage was 12.79 MB
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete
Peak memory usage was 11.68 MB
Probably permission
try
chown -R aegir (platform directory)
chown -R www-data (sites directory within platforms directory)
Yep. My
Yep. My /var/aegir/platforms/myplatform/sites/subsite.site.com directory was not writable by its owner :P
Thanks smilne23