Upgrading Drupal 6 (D6) to drupal 7 (D7)
Upgrade Steps, Common Problems and Solutions
- Backup your existing site and database.
- Log in as user ID 1 (the site maintenance user).
This is the user name that you created during the installation process for your site. - Put your site in maintenance mode
Go to the site maintenance page (Administer > Site configuration > Site maintenance orhttp://www.example.com/admin/settings/site-maintenance
). Select "Off-line" and save the configuration. If you have defined a custom maintenance theme in your settings.php file, comment it out before proceeding. - Change all themes to Garland
Go to the Themes page (Administer > Site building > Themes orhttp://www.example.com/admin/build/themes
). Enable "Garland" and select it as the default theme. If you have been using a separate theme for administration, select "Garland" for your administration theme as well. You can find the administration theme setting at (Administer > Site configuration > Administration Theme orhttp://www.example.com/admin/settings/admin
) - Disable non-core modules
Go to the Modules page (Administer > Site building > Modules orhttp://www.example.com/admin/build/modules
). Disable all modules that are not listed under "Core - required" or "Core - optional". It is possible that some modules cannot be disabled, because others depend on them. Repeat this step until all non-core modules are disabled.If you know that you will not re-enable some modules for Drupal 7.x and you no longer need their data, then you can uninstall them under the Uninstall tab after disabling them.
- Remove default settings file
On the command line or in your FTP client, remove the filesites/default/default.settings.php
- Remove all old core files and directories
Remove all old core files and directories, except for the 'sites' directory and any custom files you added elsewhere. If you made modifications to files like.htaccess
orrobots.txt
, you will need to re-apply them from your backup, after the new files are in place. - Remove uninstalled modules
If you uninstalled any modules, remove them from thesites/all/modules
and othersites/*/modules
directories. Leave other modules in place, even though they are incompatible with Drupal 7.x. - Download Drupal 7
Download the latest Drupal 7.x release to a directory outside of your web root. Extract the archive and copy the files into your Drupal directory.On a typical Unix/Linux command line, use the following commands to download
and extract:wget http://drupal.org/files/projects/drupal-x.y.tar.gz
tar -zxvf drupal-x.y.tar.gz
This creates a new directory
drupal-x.y/
containing all Drupal files and directories. Copy the files into your Drupal installation directory:cp -R drupal-x.y/* drupal-x.y/.htaccess /path/to/your/installation
If you do not have command line access to your server, download the archive using your web browser, extract it, and then use an FTP client to upload the files to your web root.
- Re-apply modifications to core files
Re-apply any modifications to files such as.htaccess
orrobots.txt
. - Make your
settings.php
file writeable
Make yoursettings.php
file writeable, so that the update process can convert it to the format of Drupal 7.x.settings.php
is usually located insites/default/settings.php
- Run the update script
Runupdate.php
by visitinghttp://www.example.com/update.php
(replacewww.example.com
with your domain name). This will update the core database tables.If you are unable to access
update.php
do the following:- Open
settings.php
with a text editor. - Find the line that says:
$update_free_access = FALSE;
- Change it into:
$update_free_access = TRUE;
- Once the upgrade is done,
$update_free_access
must be reverted toFALSE
.
- Open
- Backup your database
Backup your database after the core upgrade has run. - Upgrade fields
If you were using CCK (and perhaps additional modules) to create fields for your content types, you will need to upgrade the data in those fields as a separate step. Download the Drupal 7 CCK module, and turn on Content Migration. Go to Structure > Migrate Fields orhttp://example/com/admin/structure/content_migrate
for a page to walk you through the migration process. There are now several types of fields in core, but not every type. You might need to download Drupal 7 versions of contributed modules to support other types of fields. Learn more about migrating content from CCK to Core Fields. - Update contrib modules and themes
Replace and update your non-core modules and themes, following the procedures at http://drupal.org/node/948216 - Check the Status Report
Go to the Status Report page (Administration > Reports > Status orhttp://www.example.com/admin/reports/status
). Verify that everything is working as expected. - Make sure setting.php is secure
Ensure that$update_free_access
isFALSE
in settings.php. - Remove your site from Maintenance Mode
Go to the Maintenance Mode page (Administration > Configuration > Development > Maintenance orhttp://www.example.com/admin/config/development/maintenance
). Disable the "Put site into maintenance mode" checkbox and save the configuration.
Remove write permissions.
Common Problems
Problem
Warning: Invalid argument supplied for foreach() in filter_list_format() (line 675 of /.../modules/filter/filter.module
Solution
filter_fix-1067998-8.patch
modules/filter/filter.module | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 773fa80..1851014 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -671,7 +671,8 @@ function filter_list_format($format_id) { if (!isset($filters[$format_id])) { $format_filters = array(); - foreach ($filters['all'][$format_id] as $name => $filter) { + $filter_map = isset($filters['all'][$format_id]) ? $filters['all'][$format_id] : array(); + foreach ($filter_map as $name => $filter) { if (isset($filter_info[$name])) { $filter->title = $filter_info[$name]['title']; // Unpack stored filter settings. -- 1.7.1.1
Problem
Undefined index: required in field_default_form() (line...
Solution
go the the Manage fields page and just save it. No need to add a new field. Just do that for each content type and the error is gone.
Problem
When looking at admin/reports/fields it shows the following errors:
- Notice: Undefined index: comment_node_panel in _field_ui_bundle_admin_path() (line 309 of /opt/www/support/drupal7/modules/field_ui/field_ui.module).
- Notice: Undefined index: comment_node_panel in field_ui_fields_list() (line 24 of /opt/www/support/drupal7/modules/field_ui/field_ui.admin.inc).
- Notice: Undefined index: comment_node_image in _field_ui_bundle_admin_path() (line 309 of /opt/www/support/drupal7/modules/field_ui/field_ui.module).
- Notice: Undefined index: comment_node_image in field_ui_fields_list() (line 24 of /opt/www/support/drupal7/modules/field_ui/field_ui.admin.inc).
- Notice: Undefined index: comment_node_helpdesk_kb in _field_ui_bundle_admin_path() (line 309 of /opt/www/support/drupal7/modules/field_ui/field_ui.module).
- Notice: Undefined index: comment_node_helpdesk_kb in field_ui_fields_list() (line 24 of /opt/www/support/drupal7/modules/field_ui/field_ui.admin.inc).
- Notice: Undefined index: image in _field_ui_bundle_admin_path() (line 309 of /opt/www/support/drupal7/modules/field_ui/field_ui.module).
- Notice: Undefined index: image in field_ui_fields_list() (line 24 of /opt/www/support/drupal7/modules/field_ui/field_ui.admin.inc).
- Notice: Undefined index: image in _field_ui_bundle_admin_path() (line 309 of /opt/www/support/drupal7/modules/field_ui/field_ui.module).
- Notice: Undefined index: image in field_ui_fields_list() (line 24 of /opt/www/support/drupal7/modules/field_ui/field_ui.admin.inc).
- Notice: Undefined index: panel in _field_ui_bundle_admin_path() (line 309 of /opt/www/support/drupal7/modules/field_ui/field_ui.module).
- Notice: Undefined index: panel in field_ui_fields_list() (line 24 of /opt/www/support/drupal7/modules/field_ui/field_ui.admin.inc).
- Notice: Undefined index: helpdesk_kb in _field_ui_bundle_admin_path() (line 309 of /opt/www/support/drupal7/modules/field_ui/field_ui.module).
- Notice: Undefined index: helpdesk_kb in field_ui_fields_list() (line 24 of /opt/www/support/drupal7/modules/field_ui/field_ui.admin.inc).
- Notice: Undefined index: helpdesk_kb in _field_ui_bundle_admin_path() (line 309 of /opt/www/support/drupal7/modules/field_ui/field_ui.module).
- Notice: Undefined index: helpdesk_kb in field_ui_fields_list() (line 24 of /opt/www/support/drupal7/modules/field_ui/field_ui.admin.inc).
Solution
This is discussed at http://drupal.org/node/686938 and http://drupal.org/node/1079966
Instructions for using patches are at http://drupal.org/patch/apply