Hi folks,

I've just moved our domain to a new host but am having problems getting my site working. The steps I followed were:

1. Create backups of existing site including databases and a full home directory download
2. Changed nameservers
3. Upload drupal codebase
4. Upload modules, theme & files directory
5. Created new database
6. Imported database via PHPMyAdmin

But I'm getting loads of errors when I go to the site at www.westburygp.co.uk

Can somoeone take a look and let me know whats going on?

Comments

mdlueck’s picture

#1 seems good, #3 and #4 sound a bit odd in comparison... I would have expected to hear "restored all files" or something like that. Are you confident that "you have all of the right files in the right places?" Did ownership / permissions come through the backup/restore in good order?

Did the MySQL DB version change? Did you make sure you backed up / restored specifying a UTF8 character set? I went through a MySQL 4.0.x to MySQL 5.0.x, specified the UTF8 character set for both the backup and restore, conversion was a complete success.

cayenne’s picture

What the code is looking for seems not to be there. Lots of unknown columns, fields, etc. Perhaps you might take a look at your database with phpmyadmin and see whether the tables are set up at all.

When I move a database, I use phpMyAdmin and select the DROP TABLE option when I export.

I assume that you ran your codebase with an un-exported naked brand new database first to make sure there were no surprises there? Sometimes that reveals things like a change in PHP version or capabilities that mess you up.

Good luck.

:)

lainwired’s picture

did you edit settings.php to use your new sql server's info?

$db_url = 'mysql://user:pass@localhost/databasename';

some webhosts have seperate sql servers so they are not on the local host you need to change the server address to your webhost's sql server. hope this helps

lainwired’s picture

did you edit settings.php to use your new sql server's info?

$db_url = 'mysql://user:pass@localhost/databasename';

some webhosts have seperate sql servers so they are not on the local host you need to change the server address to your webhost's sql server. hope this helps

Dubber Dan’s picture

Thanks for the replies folks. I think I'm gonna scrub it and start again, doing the following:

1. Upload drupal
2. Create empty database
3. Go to domain to test a clean install
4. Import backup database
5. Upload files directory, theme, etc
6. Edit settings.php
7. Go to domain to test site

Dubber Dan’s picture

Did a clean install of a new instance of Drupal and that worked fine, able to create the 1st user etc.

Then imported (via MyPHPAdmin) the backed up database for my site and now get the following errors when going to www.westburygp.co.uk:

Warning: Unknown column 'referer' in 'field list' query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', 'Unknown column 'weight' in 'order clause'\nquery: SELECT name, filename, throttle, bootstrap FROM system WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC in /home/.krone/dubber/westburygp.co.uk/includes/database.mysql.inc on line 121.', 2, '', 'http://www.westburygp.co.uk/?q=user/1', 'http://www.westburygp.co.uk/?q=user/1/edit', '194.176.105.41', 1189085560) in /home/.krone/dubber/westburygp.co.uk/includes/database.mysql.inc on line 121

Warning: Unknown column 'referer' in 'field list' query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', 'Unknown column 'referer' in 'field list'\nquery: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'access denied', '<em>user/1</em> denied access.', 1, '<a href=\\"/user/1\\" class=\\"active\\">view</a>', 'http://www.westburygp.co.uk/?q=user/1', 'http://www.westburygp.co.uk/?q=user/1/edit', '194.176.105.41', 1189085560) in /home/.krone/dubber/westburygp.co.uk/includes/database.mysql.inc on line 121.', 2, '', 'http://www.westburygp.co.uk/?q=user/1', 'http://www.westburygp.co.uk/?q=user/1/edit&# in /home/.krone/dubber/westburygp.co.uk/includes/database.mysql.inc on line 121

Fatal error: Call to undefined function block_list() in /home/.krone/dubber/westburygp.co.uk/includes/theme.inc on line 936

Warning: Unknown column 'referer' in 'field list' query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', 'Unknown column 'cache' in 'field list'\nquery: INSERT INTO sessions (sid, uid, cache, hostname, session, timestamp) VALUES ('u7cq4mggc71rs3233k2bnqgg71', 0, 0, '194.176.105.41', 'messages|a:1:{s:5:\\"error\\";a:2:{i:0;s:299:\\"user warning: Unknown column 'weight' in 'order clause'\\nquery: SELECT name, filename, throttle, bootstrap FROM system WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC in /home/.krone/dubber/westburygp.co.uk/includes/database.mysql.inc on line 121.\\";i:1;s:595:\\"user warning: Unknown column 'referer' in 'field list&#039 in /home/.krone/dubber/westburygp.co.uk/includes/database.mysql.inc on line 121
Dubber Dan’s picture

Anyone got any suggestions?

mdlueck’s picture

Hi Dan-

The steps you outline seem a bit off target to me...

1. Upload drupal
2. Create empty database
3. Go to domain to test a clean install
4. Import backup database
5. Upload files directory, theme, etc
6. Edit settings.php
7. Go to domain to test site

I would suggest:
1. Create empty database
2. Import backed-up database
3. Upload backed-up directory structure
4. Edit settings.php to point at the new database
5. Go to domain to test site

Dubber Dan’s picture

My steps one and two were only there to test that a clean install of drupal works, which it did. If I then replace the database with my back up I get the errors above. I've just followed your steps (using 2 different database backups) and I still get the errors above.

mdlueck’s picture

What version of MySQL are you coming from / importing to?

Did you specify utf8 be the character set for both the backup and restore? I have successfully migrated MySQL 4.0.x to MySQL 5.0.x specifying utf8 be the character set on both the backup and restore command.

But... I would not think you would get that severe of an error if it were simply a character set issue.

Possibly post the exact syntax you used for both the backup and restore - maybe something is glaringly wrong.

Oh, and I assume that once you had clean Drupal up and running, you did not restore the settings.php file as it already had the correct settings to connect to the new MySQL server, correct?

Dubber Dan’s picture

Not sure what I'm coming from, but I think it was 4. I'm going to 5.

I did specify utf8 for the restore, but not sure about the backup as it was one generated by the previous host. I've successfully restored from these sort of backups before and moved another domain between the same hosts using this method before.

mdlueck’s picture

Moving from the same server to the same server? (Those other domains?)

How about checking to see that various tables actually look OK.

Unknown column 'referer' in 'field list' query: INSERT INTO watchdog

So check the watchdog table and see if it even has a referer col, etc... I would just do:

select * from watchdog;

Dubber Dan’s picture

The other domains were moved from the same old host to the same new host as this instance, using the same method as this.

I've looked into the tables and they seem to be right. There are plenty of nodes and I can see the titles, contents, etc of them.

Checking the Watchdog I can't see anything for "referer". In PHPMyAdmin would that be in the field list?

mdlueck’s picture

Yes, I believe that SQL is looking for the watchdog table to have a referer col. I will snoop inside my Drupal databases soon to compare.

Do your other databases that are working properly have such a col, or maybe a difference in the cols?

Dubber Dan’s picture

Hmmm, very odd...

My other sites do have a referer column, but none of my backups for this site do. Yet I'm positive that I've used one of the old ones for restoring before moving host.

Is it possible to create the referer column somehow?

mdlueck’s picture

Try and see if it makes things better. I doubt it had any constraints on the col.

mdlueck’s picture

Make a copy of the backup file you wish to restore, edit it and see if you can get the syntax adjusted properly to simply add that one col. I think that it likely involves the table definition (DDL), but am unsure if it involves the actual data rows. Have to check and see if they are mapped, each col, to a specific named col or if it is simply "next col... next col..." Given the latter, then insert an empty place holder for the new col.

This idea I think is better given the fact that it is likely to produce a DB schema that is closer to the Drupal standard. (that one col where it should be, rather than as the last col.)

Dubber Dan’s picture

Ermmmmmm, any pointers on how to do all that?

mdlueck’s picture

The existing watchdog table is basically useless. So I suggest modifying the DDL that creates the table, and not import anything from the old server. From a backup of one of my sites:

--
-- Table structure for table `watchdog`
--

DROP TABLE IF EXISTS `watchdog`;
CREATE TABLE `watchdog` (
  `wid` int(11) NOT NULL auto_increment,
  `uid` int(11) NOT NULL default '0',
  `type` varchar(16) NOT NULL default '',
  `message` longtext NOT NULL,
  `severity` tinyint(3) unsigned NOT NULL default '0',
  `link` varchar(255) NOT NULL default '',
  `location` text NOT NULL,
  `referer` varchar(128) NOT NULL default '',
  `hostname` varchar(128) NOT NULL default '',
  `timestamp` int(11) NOT NULL default '0',
  PRIMARY KEY  (`wid`),
  KEY `type` (`type`)
) ENGINE=MyISAM AUTO_INCREMENT=2426 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `watchdog`
--

<-- Begin cut -->
/*!40000 ALTER TABLE `watchdog` DISABLE KEYS */;
LOCK TABLES `watchdog` WRITE;
INSERT INTO `watchdog` VALUES (.......);
UNLOCK TABLES;
/*!40000 ALTER TABLE `watchdog` ENABLE KEYS */;
<-- End cut -->

That backup is of Drupal 5.2!!!

So, I suspect the referer line is missing in your version. Modify the DDL, and cut out the lines indicated to be cut.

Give that a try! Hope it works! ;-)

Dubber Dan’s picture

Thanks again for the reply, but I'm lost as to what your actually saying I need to do! Can you give me some idiots steps to follow as I've never really delved into databases so don't even know where to start?

mdlueck’s picture

1) Make a copy of the database backup file.
2) Make sure the table definition for watchdog is like I pasted in. I suspect it is missing the referer column.
3) Note the lines I said to cut, and cut those. Those are restoring entries to the watchdog table, which existing data is useless for that table and is safe to dump.
4) Save / Exit / and build the database from that customized version.

Better?

Dubber Dan’s picture

That's sounding great thanks. Just one more thing. What software do I do the editing in, as I tried Crimson Editor and it's cropped some of the lines as they are too long, and notepad is just random characters?

mdlueck’s picture

I happen to use Visual SlickEdit as my main text editor while in GUI mode.

I suppose a good Linux text mode editor would edit it without messing up the file. Happen to have nano handy? If your distro did not install it by default, hopefully they have it packaged and you can easily add the package.

mdlueck’s picture

I recall using Kate on Linux (GUI) when I did not have Visual SlickEdit available. I think Kate requires KDE. It has been a while...

Dubber Dan’s picture

Erm, I don't use Linux, it's just that my hosting is Linux based.

mdlueck’s picture

Do you have SSH capabilities on the server? Edit it directly on the server.

If not, best get a real text editor for your computer. Notepad is NOT a text editor! ;-)

Dubber Dan’s picture

Has taken me ages to get round to this, but have added in the referrer line to the database, then re-uploaded. Am now just getting the one error thrown up:

Fatal error: Call to undefined function block_list() in /home/.krone/dubber/westburygp.co.uk/includes/theme.inc on line 936

www.westburygp.co.uk

So that's progress of sorts. What next folks?

mdlueck’s picture

Greetings Dan- I had been thinking of you now and then. I am indeed glad to see you got past that error.

Since that appears to be a core Drupal file, I suggest you unpack the official tar of what ever version you are running on and compare those files to the files from your backup.

I recall you had trouble editing the database file, and Diffs I usually do again with Visual SlickEdit. If you want me to have a look at it, please contact me directly to tell me where I can fetch a backup file set from.

Any files seeming not the official release version I would evaluate, and perhaps uploading the official version will make the difference.

Dubber Dan’s picture

I managed to get the database edited after I downloaded Textpad (www.textpad.com) which got me past the initial set of errors, so thanks for that.

I need to get a temporary page up for th site so people know what's what, so was going to move the drupal install to a subfolder. Once I've done that I'll be in touch ;-)

mdlueck’s picture

I need to get a temporary page up for th site so people know what's what, so was going to move the drupal install to a subfolder.

You could edit the .htaccess file in the web root and specify index.html as the default rather than index.php. We could manually specify index.php to work on the site. I think that would be enough editing. When we run Drupal parallel to an existing static HTML site, I edit one of the core Drupal files, but I do not think that necessary in this case.

Just a thought...