I'm posting here after my post on Webmasters was flagged to be moved here.
First of all, I'm new to Drupal and the work I have to do is some kind of too hard.
My old colleague (webmaster) had a server with a multisite Drupal 6 installation.
Sites and their dirs were (e.g.)
Sites Site directory
b.a.mycompany.com /drupal_install_dir/sites/b.a.mycompany.com
c.a.mycompany.com /drupal_install_dir/sites/c.a.mycompany.com
d.a.mycompany.com /drupal_install_dir/sites/d.a.mycompany.com
Unluckily my colleague moved and server hdd aren't in my hands: all I have is a backup of /drupal_install_dir and three sql dumps (one for each site).
I had to restore three sites, but changing them as
z.mycompany.com/b
z.mycompany.com/c
z.mycompany.com/d
Beeing a sysadmin, I
- Extracted tar.gz backup file under wwwroot (let's call full path to extracted directory /new_install_dir)
- Restored three databases
- Created mysql users and give them correct GRANTS on databases
Then (trying to restore at least first site) I changed /new_install_dir/sites/settings.php putting correct database connection data and new basepath.
But there is no way I can see my new site, simply it doesn't work.
Watching /var/log/apache2/error.log I saw Drupal searching for main drupal database; so I created that db too setting user and grants, but dump file is empty. Well, now I can run something like install.php or update.php, but my site is not shown.
Is there something I can do?
Do I have to walk another way? Consider I searched the web, but I'm not able to find a guide that can help me for my problem.
Ah, I forgot: before producing the backup, my colleague set site in maintenance mode.
When I try to run z.mycompany.com/?q=user (trying to login) nothing happens.
I'm really stuck...
UPDATE
Those are my tries (unsuccesful)
- Cleared anything and started from the beginning
- Extracted Drupal6 installation in drupal6 directory
- Executed (in wwwroot)
ln -s drupal6 b
: with this every request for z.mycompany.com/b is managed by Drupal6 - Created sites/z.mycompany.com.b, restored old backup coming from old server here, edited settings.php with $baseurl=https://z.mycompany.com/b and correct database params
Now I tried two things:
- Restore db from backup (without modifying entries in it)
- Restore db from an edited version in which I changed various entries pointing to old site
Both don't work: either I get a Drupal "Page not found" or a partial site.
I also tried to look at sites.php, but I don't think this can solve my problem: my server, my ip, everything is changed!! IP for b.a.mycompany.com is different from the one for z.mycompany.com adn I cannot have a dns redirection.
MY SOLUTION:
I finally managed to make my new site live.
In addition to what I did in my UPDATE section, I had to:
- Edit my database dump to change every reference to my old site.
Note that I had a lot of different kind of references (base urls, sites dir, etc.), so Notepad++ was my friend.
Another note: some of the entries are serialized (with phpserialize()
), so you have to manage arrays end edit string lengths too.
Remember that you don't need to restore cache... and watchdog tables - Restore my site dropping sites/all directory (with that on, I wasn't able to start Drupal correctly)
- Restore files and dirs permission (e.g.
chown -R www-data:root sites/z.mycompany.com.b
) - Log in as admin and perform some maintenance and run cron.
- Restore sites/all directory and restore files permission
chown -R www-data:root sites/all
- Modules and themes in database were automatically turned off: turn them on inside administation panel
I had to tell you that /var/log/apache2/error.log was really needful to discover something I missed or did wrong.
\chmod -R 755 *; find * -type f | xargs chmod 644;