大网数据广告活动
网站运营与故障问答

creating an archive/snapshot of a wordpress site -- how?

· 52CE 我爱测

I help to run a 15 year old site which is powered by wordpress (along with various kinds of legacy static content). The site has probably 20,000 wordpress posts. The main site administrator wants to stop adding new content to thi…

问题原文

原帖链接 · idiotprogrammer · CC BY-SA 3.0

I help to run a 15 year old site which is powered by wordpress (along with various kinds of legacy static content). The site has probably 20,000 wordpress posts. The main site administrator wants to stop adding new content to this site and wants a way to make an archive of the site available without allowing editing. He also wants (if possible) a way to preserve the URLs.What options are available for him to maintain the site over the long term with minimal effort? Here are some options we have considered:

  1. hosting on wordpress.com and keeping it live. (So wordpress.com will do the necessary site updates.

  2. just letting it be available from archive.org (via alexa). The main problem with this is that alexa/archive.org loses a lot of images and doesn't allow searches within the domain itself.

  3. searching for some tool to spit out posts and pages into static HTML pages. (This sounds theoretically possible, but we haven't really investigated how to do so).

We are greatly constrained by cash, but it seems all we need is a hosting service to apply security updates to the server and database and to do security audits.

Can you recommend a process for putting a wordpress site into a deep freeze or at least a semi-long term hibernation? What are some options for archiving a wordpress site to preserve the URLs and keep it safe for medium or long term?

It's probably worth asking how we would harden the wordpress database and what kinds of security settings would we need for the webhosting services?

I suppose we could turn off comments on wordpress and probably disable user accounts except for maybe one admin account. We have about 15 plugins installed (yes, don't get me started), so there needs to be some plugin management over time as plugins became unsupported or useless.

Related: this interesting article about posthumous web hosting http://code.tutsplus.com/tutorials/hosting-your-website-after-death--cms-23492

已采纳解答

原帖链接 · Tom Brossman · CC BY-SA 3.0

Your third option is definitely the way to go - leave all the bloat behind and go static. I recommend Jekyll for managing the static site since it has the largest number of users, which makes finding tutorials and troubleshooting answers easier.

There are two approaches you can take, either export your WP site to Jekyll-ready output with a plugin or set up Jekyll first and use it to import your site.

Posting a complete tutorial on how to export/import the site and set up Jelyll are way beyond the scope of this site but that should get you started. Once you have the site converted to completely static files, you can put everything on your choice of hosting services. AWS's S3 or CloudFront are popular choices and are inexpensive, but you can put the static files on almost any hosting service.

If you are worried about setting up Jekyll, try doing it on a virtual machine using something like VirtualBox. It's free and you won't make a mess of your system if you run into problems. As always, make a backup of the site database and files before trying anything new.

If you have SSH access to the machine currently hosting the site you can take a quick backup like this, substituting the UPPERCASE for whatever your variables happen to be (hopefully this is self-explanatory):

Database backup mysqldump --lock-tables -u DATABASE_USER -pPASSWORD DATABASE_NAME > /PATH/TO/BACKUP/SITE_NAME-database-backup-$(date +%Y%m%d).sql

Site files: tar czf /SAVE/LOCATION/SITE_NAME-files-backup$(date +%Y%m%d).tgz -C /var/www/SITE-FOLDER/ . (don't forget that trailing space-then-dot . it's not punctuation or a typo).

Don't output the site or DB backup to somewhere the web server can serve them obviously, or anyone can download them and discover your configuration files and passwords. I see a surprising number of WP sites doing this, try visiting the occasional WP site's IP address directly to see for yourself - it shouldn't take many tries.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。