Question

I have follow the below steps to back up source and then restore to target site.

1) On the source server, upload the backup and migrate module

2) On the source server, take a backup of the database using the B&M module

3) Copy all the site files - Drupal core, modules, themes, and your files folder, and migrate them to the target server in the exact same folder structure as the source server.

4) After migrating all the files to the target server, delete settings.php, and make a copy default.settings.php called settings.php

5) Install Drupal as a new installation on the target server

6) Enable the backup and migrate module on the target server

7) Use the B&M module to import the database backup you took in step 2

8) Clear the cache.

9) Run cron

10) Ran Update.php

Problem: My target site is not updated. When I go to admin>find content, I dont see any content there.

enter image description here enter image description here

I accessed the target site database and noticed that total of 9,970 records exist.

Do you know why target site is not being updated even though database has records?


Update #1

1) Source site database has 165 tables and target database has 243 tables after I complete the above steps.

2) In target database, Checked all tables > selected Empty > now target site has 0 records but all the tables exist.

3) In source database, I exported the database.

4) In target database, I imported the database. I get this error:

Error SQL query:

-- -- Dumping data for table drup_block -- INSERT INTO drup_block (bid, module, delta, theme, status, weight, region, custom, visibility, pages, title, cache, css_class) VALUES (1, 'system', 'main', 'bartik', 1, 0, 'content', 0, 0, '', '', -1, ''), (2, 'search', 'form', 'bartik', 1, -1, 'sidebar_first', 0, 0, '', '', -1, ''), (3, 'node', 'recent', 'seven', 1, 10, 'dashboard_main', 0, 0, '', '', -1, ''), (4, 'user', 'login', 'bartik', 1, 0, 'sidebar_first', 0, 0, '', '', -1, ''), (5, 'system', 'navigation', 'bartik', 1, 0, 'sidebar_first', 0, 0, '', '', -1, ''), (6, 'system', 'powered-by', 'bartik', 1, 10, 'footer', 0, 0, '', '', -1, ''), (7, 'system', 'help', 'bartik', 1, 0, 'help', 0, 0, '', '', -1, ''), (8, 'system', 'main', 'seven', 1, 0, 'content', 0, 0, '', '', -1, ''), (9, 'system', 'help', 'seven', 1, 0, 'help', 0, 0, '', '', -1, ''), (10, 'user', 'login', 'seven', 1, 10, 'content', 0, 0, '', '', -1, ''), (11, 'user', 'new', 'seven', 1, 0, 'dashb[...]

MySQL said: Documentation

1054 - Unknown column 'css_class' in 'field list'

  1. When I refreshed my page, I get this:

fatal error: Class 'SelectQueryExtender' not found in /home/content/48/8466248/html/godrupal/includes/pager.inc on line 15

Now, I can not access my site because of the error in #5.


Update #2

1) In target site, I created a new database.

2) In target site, I imported the database from source. I got same number of tables (165 each).

3) In target site, I updated the settings.php as below:

$databases = array (
  'default' => 
  array (
    'default' => 
    array (
      'database' => 'xxx',
      'username' => 'xxx',
      'password' => 'ppp',
      'host' => 'xxxxxxx',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

Note- That is only thing I have updated in settings.php.

4) When I go to front page, I get the below error. Also I can not access the site.

Error

The website encountered an unexpected error. Please try again later.
Error messagePDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxx.semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /home/content/48/8466248/html/xxx/includes/lock.inc).
Uncaught exception thrown in shutdown function.
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxx.semaphore' doesn't exist: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1416485260563fafa04406f8.10064213 ) in lock_release_all() (line 269 of /home/content/48/8466248/html/xxx/includes/lock.inc).

Solution

When I installed drupal at source site in my cheaper domain server, I saw 'prefix' => 'drup_' in settings.php. When I installed drupal at target site in go daddy server, I saw 'prefix' => '' in settings.php. I simply updated the settings.php file in target site (added drup_ prefix). I dropped all tables from target site and then re-imported the database. Now, I am able to see both sites identical. Source site. Target site.

Was it helpful?

Solution

It's important that you empty the database (by droping all the tables: Check all > Drop) and start all over again. You basically have 2 drupal databases one with drup_ prefix and the other one with out it.

Then go to yourwebsite.com/install.php

In the install there is a prefix field, you need to put drup in that field.

OTHER TIPS

Looks like your source database used a table prefix drup. That's why your target installation looks empty.

Adjust the database-config in your settings.php

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top