Site operation and maintenance: update update Drupal 8

Copyright: Original, welcome to reprint https://blog.csdn.net/weixin_43731793/article/details/91446343

The official explanation ............ ............
https://www.drupal.org/docs/8/update/updating-drupal-8-overview-of-options

surroundings

centos 7
lamp
Drupal 8.3 --》 Drupal 8.7

1, the use of Drupal, your site into maintenance mode. to this end:

The management interface navigate to Administration> Configuration> Development> maintenance mode.

Select "will be the site into maintenance mode" check box.

Click the "Save Configuration."

Here Insert Picture Description

2, back up files and databases.

2.1, copy all the contents of files in the web root directory to a temporary folder backup:

2.2, using the mysqldump command to back up MySQL database

2.3, optional backup

If you make manual modifications such as .htaccess, composer.json or robots.txt file, copy them to a location easy to find. Because after a new Drupal core installation, you need to re-apply these changes. For example, Acquia Dev Desktop .htaccess file in the top-level directory, if it is not only the home page on your site can be used.

3. Select one of the following two options to remove the top-level directory of files, and "core" and "vendor" directory, leaving the "modules", "profiles", "sites", "themes" directory

3.1, using the shell, navigate to your Drupal installation.

cd /drupal

3.2, delete the "core" and "vendor" directory.

rm -rf core vendor

3.3, delete all the files in the top-level directory.

rm -f *.* .[a-z]*
Here Insert Picture Description

4、有时)更新包括对default.settings.php 文件的更改。这将在发行说明中注明。您可以在https://www.drupal.org/project/drupal找到适用于您的版本的发行说明。在“下载”部分下的项目页面底部,使用您的Drupal版本的链接查看发行说明。如果未列出您的版本,请使用“ 查看所有版本” 链接。在此页面中,您可以向下滚动或使用过滤器查找您的版本及其发行说明。如果更新包含对default.settings.php文件的更改,请按照下列步骤操作:

4.1、将自定义和特定于站点的条目从您创建的备份复制到新的settings.php文件中。您肯定需要提供数据库信息的行,您还需要复制已添加的任何其他自定义项。
4.2、制作新的default.settings.php文件的副本,并将副本命名为settings.php(覆盖以前的settings.php文件)。
4.3、使用不同的文件名制作settings.php文件的备份副本。
4.4、在/ sites / *目录中找到settings.php文件。(通常是网站/默认。)

5、将新文件放入顶级目录以及“core”和“vendor”目录:

5.1、使用shell
在典型的Unix / Linux命令行上,使用以下命令下载和解压缩:
wget https://ftp.drupal.org/files/projects/drupal-8.7.3.tar.gz
tar zxf drupal-8.7.3.tar.gz
5.2、上面的命令创建了一个新目录/drupal-8.7.3 ,包含所有Drupal文件和目录。输入新目录,并将“core”和“vendor”目录以及顶级目录中的文件复制到Drupal安装目录中:
cd drupal-8.7.3
cp -r core vendor /data/wwwroot/default/drupal
cp *.* .[a-z]* /data/wwwroot/default/drupal
Here Insert Picture Description

6、(可选)对文件(例如.htaccess,composer.json或robots.txt)重新应用任何手动修改。

7、更新

使用浏览器,访问http://www.example.com/update.php(用您的域名替换www.example.com)运行update.php 。这将更新核心数据库表。
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

# (Optional) If you are not a user or site with the "Manage Software Updates" permission maintenance account (created during installation) sign in, you will not be able to access update.php. Here are the steps to bypass this limitation:

7.1, use a text editor to open settings.php.
7.2, find this line:
$settings['update_free_access'] = FALSE;
7.3, will change the value to FALSE TRUE:
$settings['update_free_access'] = TRUE;
7.4, visit /update.php page again.
7.5 After completing all the above steps, for safety reasons, change the settings back FALSEis very important

8, Drupal administrators to log on using a browser and navigate to Administration> Reports> Status Report. Verify that everything is working as expected.

9, still using a browser, log in Drupal administrator and navigate to Administration> Configuration> Development> maintenance mode. Uncheck "the site into maintenance mode" check box, and then click the "Save" button.

10, updated, deleted before you download Drupal version and decompress:

rm drupal-8.7.3.tar.gz
rm -rf drupal-8.7.3

11, complete. You have to manually install and use the shell / browser successfully updated the Drupal 8 core.

Guess you like

Origin blog.csdn.net/weixin_43731793/article/details/91446343