Hi everyone,

I really need some help from the experts!

The situation is this: I installed Drupal on a server hosted by a private company. After installing a few modules and creating the theme and design of the site, i found out that the server wasn't able to run the modules i wanted. I contacted the host, who gave me a spot on another server - the host moved the files to the new server, but not the database. I kept working on the site til it was done. Except now it was up and running reaaaally slow, cause it was fetching data from the old database...

The host made a dump of the old database, I backed up the files I had on the server and then deleted everything through Filezilla. After that i put the files in for a new drupal installation, installed them so that i had the right database, uploaded my backup ftp-files, and imported the database-dump through phpMyAdmin. I figured this would do the trick and everything would work... I was unfortunately wrong.

There's no theme or content restored on the site and it just looks like drupal has just been installed....

(Btw I also did a backup through the module Backup & Migration, but when I try to restore that it spams with with the message:
user warning: in /home/kongprod/domains/kongprod.dk/public_html/includes/database.mysqli.inc on line 128.

I'm new to Drupal, and especially database/server issues so i'm really lost now.

I've installed Drupal 6.16, a long list of modules and the site is located on kongprod.dk.
The old database was on the server with php 4.xxx, the new runs php 5.xx with mysqli.

If any other information is needed please just ask. I really hope there's something I can do to bring the site back.

Thank you for your time!

Comments

cog.rusty’s picture

Look around a bit
- in your files (with FTP) to make sure that your modules and themes have been uploaded to sites/all/modules and sites/all/themes
- in the database (with phpmyadmin) to make sure that your content is in the nodes and node_revisions tables and that there is only one database and it is the right one.

If everything seems to be there,
- try running update.php (it does some cleanup work)
- visit the /admin/build/modules and /admin/build/themes pages to see if Drupal sees your modules and your themes.

Penidray’s picture

In the new database i've checked the nodes and node_revisions tables, and it looks like the content is there.
The pages and galleries ive created are named with the right titles.
But even though the names are there, they won't show, and I can't access the admin-page, plus nothing happens when trying to run the update.php.

:-/
After restoring the old site which is referring to the old database, ive set up a test-site so I won't mess up the old one til everything is right again. The test-site is at www.test.bjerknaes.com, in case you want to see the which pages isn't showing.

Thanks again for your help so far. :)

FanisTsiros’s picture

I think this was not the right procedure...

You should: (If you have a full backup of your old site and also an mysql dump)

1. create a new database in your new hosting provider (probably with the same name and user name - pass if you can)

2. upload your mysql backup with phpmyadmin in your new fresh database

3. Check with phpmyadmin that everything is ok with your new database (tables created and data is there)

(now DO NOT MAKE a new drupal installation, there's no need to do this)

3. Upload your full backup in your new hosting provider
Well here is a problem: When you try to upload your sites/default/* directory you have to change permissions for default folder and also for settings.php file. Check if these files were uploaded or not.

Change settings.php permissions to 777 and default folder to 755 (was 444 and 555)

Try to (re)upload these files if not uploaded

4. Change your settings.php file to reflect the new environment (database name, user pass) if there is a new database name and or user and pass (see step 1)

REMEMBER to restore back permissions to 444 for sttings.php file and to 555 for default folder.

That's it !

Good luck

ReliabilityConsistencyFeedback

Penidray’s picture

Thank you so much guys!

Fanis I went through your guide, step by step and now I have most of the site back online.
At the moment I have all of the old site restored on the new server, but with a link to the old database. If I change the link to the new database, it's only some nodes that shows, other just gives me the message:
'Site off-line
The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.

If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider's database server is running. For more help, see the handbook, or contact your hosting provider.

The mysql error was: Access denied for user 'xxx'@'xxx.xxx.dk' (using password: YES)."

So to me this seems like all the files ive uploaded through ftp are just fine, but it's the new database that is lacking the content. Is that right? And how do I get that content back then? Make a new dump of the old database or is there a way to see if the dump contains all the right info?

Hehe yeah alot of questions, but you guys have helped me to this point :D

cog.rusty’s picture

Your site is not really working, just that splash page. The problem is what the error message says: "Access denied for user 'xxx'@'xxx.xxx.dk' (using password: YES)"

You need to make sure that your database connection information in your new site's settings.php file, in the line $db_url, are correct.

Penidray’s picture

Thank you cog.rusty! I went through the information and found out that I had two typos :-/ Now everything seems to work as planned!
You guys has saved me from alot of frustration and work, thank you so very much!
<3

Penidray’s picture

Hmm, so I tried running cron now, but I get the following error:
Fatal error: Cannot redeclare db_status_report() (previously declared in /home/kongprod/domains/kongprod.dk/public_html/includes/database.mysqli.inc:23) in/home/kongprod/domains/kongprod.dk/public_html/includes/database.mysql.inc on line 36

I'm afraid to mess things up if I start looking into those files, so any idea what should be done?

FanisTsiros’s picture

Check this page http://drupal.org/node/72099

There must be something wrong during uploading or something.

Edit:

Also check again your settings.php file in line:

$db_url = 'mysqli://username:password@localhost/databasename';

Is it mysqli or mysql ?

If you use php 5 i think it must be mysqli

Also try to run update.php

ReliabilityConsistencyFeedback

Penidray’s picture

It is mysqli.
And the update.php runs fine fortunately :) It's just when running cron.php I get the message.

cog.rusty’s picture

Check your settings.php file to see if you have two different $db_url lines, one with mysqli: and one with mysql:

Penidray’s picture

There's only one line, which is mysqli.

Penidray’s picture

Heya,

The site still has the cron-error issue. Anyone got any thoughts about this that I could try out? I'm really lost and i've tried turning modules off etc., nothing works.

cog.rusty’s picture

Have you set any alternative $db_url in your site's settings.php file in order to switch databases using db_set_active()?

If you have, make sure that either all of them use mysql:// or all of them use mysqli://
It looks like they are mixed together.

Penidray’s picture

There's only a few "open" settings (rest is commented out), and none of them seems to be wrong as far as I know.

I've pasted the parts that haven't been out-commented, into this post (and changed the password to X's), if you want I can send you a copy of the file as well:

$db_url = 'mysqli://kongprod_drupal:XXXXXXX@localhost/kongprod_drupal';
$db_prefix = '_drupal';

$update_free_access = FALSE;

ini_set('arg_separator.output', '&');
ini_set('magic_quotes_runtime', 0);
ini_set('magic_quotes_sybase', 0);
ini_set('session.cache_expire', 200000);
ini_set('session.cache_limiter', 'none');
ini_set('session.cookie_lifetime', 2000000);
ini_set('session.gc_maxlifetime', 200000);
ini_set('session.save_handler', 'user');
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
ini_set('session.use_trans_sid', 0);
ini_set('url_rewriter.tags', '');

cog.rusty’s picture

I see. You have only one mysqli:// connection there, which is fine.

But according to the error message, something somewhere uses an additional mysql:// (without the "i") connection during cron run.

Maybe you can make the error message disappear by using mysql:// as well, to avoid any conflicts, but this is not a clean solution because it leaves the mystery unsolved.

Penidray’s picture

You are right, the error message does disappear when i change it from mysqli to mysql. :)

I guess i'll have to leave it at, since I can't figure out where any other "mysql" should be at. :-S

Atleast it works now! :) Thanks a bunch for helping out all along the way!

<3

Penidray’s picture

Final note...
Ok so I figured out what caused the error.
After turning off the module: Backup & Migrate, everything is back to normal... Without having to edit the settings.php.

Hope that will help solve problems in the future, for people that is experiencing the same thing i've been through.

cog.rusty’s picture

My guess is that the module had that "mysql://" connection string stored in the 'variable' table, in a variable named backup_migrate_something, and that it picked up that connection string at a previous time.

saltcod’s picture

For others who might come along...

Any reasonably sized site will max out the phpmyadmin upload limit. They way I move sites around is via the command line:

First, login to mysql and make a new, empty database:

create database drupaldb

Then, exit mysql, and run the following:

mysql --user=Timmy --password=secretpassword drupaldb < old-site-db-dump.sql

If you have already made an old sql dump, this will populate the drupaldb you just made.

Voila.