drupal 电商网站_备份和还原Drupal网站

drupal 电商网站

如何备份和还原Drupal安装 (How To Backup and Restore a Drupal Installation)

Many webmasters who use Drupal, but aren’t aware about the process taking backup and restore it. This may be due to the lack of knowledge about the importance of backup.

许多使用Drupal的网站管理员,但并不了解执行备份和还原的过程。 这可能是由于缺乏有关备份重要性的知识。

There exists 4 primary scenarios when having the latest backup files are essential:

当需要最新的备份文件时,存在四种主要方案:

A. When users upgrade to a higher edition of Drupal, it is suggested to keep a backup of your database and other files. Incase you come across an issue during the upgrade, there are chances of losing data, having a backup would fade-out the chances of data loss.

答:当用户升级到更高版本的Drupal时,建议保留数据库和其他文件的备份。 如果您在升级过程中遇到问题,则有丢失数据的机会,进行备份会消除丢失数据的机会。

B. Incase the current server faces an issue or you are switching from a hosting provider to Eukhosts affordable web hosting servers, having a back-up of your own, can reduce the chances of data loss. You can simply upload the backed up file and proceed normally with your activities.

B.如果当前服务器遇到问题,或者您从托管服务提供商切换到Eukhosts 负担得起的Web托管服务器,并拥有自己的备份,则可以减少数据丢失的机会。 您可以简单地上传备份的文件并正常进行活动。

C. With an increase in the number of attacks recently, there is a possibility that you become the victim and all your data is gone. So, as a counter-active measure, you can upload the back up and work as if nothing had happened.

C.随着最近攻击次数的增加,您有可能成为受害者并且所有数据都丢失了。 因此,作为对策,您可以上传备份并进行工作,就好像什么都没发生一样。

D. If you intend creating a test website of your Drupal installation, or you wish to test modules and templates, then a backup proves highly essential. Therefore, inorder to avoid issues, it is suggested to avoid testing in a live environment.

D.如果您打算创建Drupal安装的测试网站,或者希望测试模块和模板,那么备份就显得至关重要。 因此,为了避免出现问题,建议避免在实际环境中进行测试。

Affordable Web Hosting

There have been number of instances in the past where the entire website content was washed out due to attacks, hacks, during testing etc. If they had a backup or if their web hosting provider was capable enough to take regular backups, things could have been reverted.

过去有很多实例,由于攻击,黑客入侵,测试期间等原因,整个网站内容都被洗掉了。如果他们有备份,或者他们的网络托管提供商有能力进行定期备份,那本来可以已还原。

How to go about taking a backup of your Drupal website ?

如何备份您的Drupal网站?

Using a module, users can take backup of each file and database and club it into a single tar.gz file. The simplest method of restoring the files, is by uploading it via. a FTP client onto the server. Further, SSH using PuTTy to the command directory and enter the following in the command line:

使用模块,用户可以备份每个文件和数据库,并将其合并为一个tar.gz文件。 恢复文件的最简单方法是通过上传。 FTP客户端连接到服务器。 此外,使用PuTTy SSH到命令目录,然后在命令行中输入以下内容:

tar -xvvzf drupalbackup.tar.gz

焦油-xvvzf drupalbackup.tar.gz

This would extract the files and the drupal-backup.sql.gz as well.

这还将提取文件以及drupal-backup.sql.gz。

If you are changing the website location i.e. switching from domainnameA to domainnameB or moving the data over to a sub-domain everything mentioned would be required since the same database would be used. Your website would still function normally but from a different domain/sub-domain name. But, you need to bear in mind that the site is still using the same database.

如果要更改网站位置,即从域名A切换到域名B或将数据移至子域,则将需要使用上述所有内容,因为将使用同一数据库。 您的网站仍可以正常运行,但是使用其他域名/子域名。 但是,您需要记住该站点仍在使用相同的数据库。

In this case, there are certain aspects that must be considered. You must make sure that the site is functional from the old location, as this would be considered to be content duplication by the search engines and might penalise you. To avoid that, using phpmyadmin, you must make a new database. Make changes to the Drupal config files in a way that it reads the new database.

在这种情况下,必须考虑某些方面。 您必须确保该站点从旧位置开始运行,因为搜索引擎会将其视为内容重复,并且可能会对您造成不利影响。 为了避免这种情况,必须使用phpmyadmin创建一个新数据库。 以读取新数据库的方式对Drupal配置文件进行更改。

\sites\default\settings.php

\ sites \ default \ settings.php

Need to know information :

需要知道的信息:

It might be possible that the file is set as read-only by default. Incase you make amendments to it, get assured that the file permissions aren’t left writable which can make you prone to attacks and can be prone to security risks.

默认情况下,可能会将文件设置为只读。 如果您对其进行了修改,请确保文件权限不可写,这会使您易于受到攻击,并容易造成安全风险。

You can see that the file would have only two lines :

您可以看到该文件只有两行:

$db_url = ‘mysql://account:[email protected]/dbname’;

$ db_url ='mysql:// account: [电子邮件保护] / dbname';

$db_prefix = ”;

$ db_prefix =”;

You simply need to replace the dbname with your database name in phpmyadmin. FYI. the account name and the password is same as that of your MySQL account.

您只需要用phpmyadmin中的数据库名称替换dbname。 仅供参考。 帐户名和密码与您MySQL帐户相同。

Also, make sure that the latest ‘settings.php’ file has been uploaded as well. Since the file is usually set as read-only, the FTP client might not allow you to upload and replace the existing file over the server. In that case, you are required to ‘delete‘ the file on the server. Then try accessing your site in a browser, you would probably be given an error saying “Unsupported database type”. Upon uploading the new settings.php file and refreshing the browser, a blank page would be displayed. This is a pointer towards the fact that the database isn’t accessible. Now, you must upload the backup of your database and then refresh the browser. You should be able to access your website normally.

另外,请确保还上传了最新的“ settings.php”文件。 由于该文件通常设置为只读,因此FTP客户端可能不允许您通过服务器上载和替换现有文件。 在这种情况下,您需要“ 删除 ”服务器上的文件。 然后尝试在浏览器中访问您的站点,您可能会看到一条错误消息“ Unsupported database type” 。 上载新的settings.php文件并刷新浏览器后,将显示空白页面。 这表明数据库不可访问。 现在,您必须上载数据库的备份,然后刷新浏览器。 您应该能够正常访问您的网站。

Note : Having your Drupal website backup using any of the Offsite Backup Plans can help you keep your website data secure.

注意:使用任何非现场备份计划进行Drupal网站备份都可以帮助您确保网站数据的安全。

翻译自: https://www.eukhost.com/blog/webhosting/backup-and-restore-drupal-website/

drupal 电商网站

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值