网站/WordPress从虚拟主机搬家到VPS上

拖了一个月终于着手并且完成了。其实没有什么难的。但是因为我对Linux的了解非常局限,还是花了一番功夫,同时学了很多东西,在这里记一下。没有试图写一篇“手把手教你搬WP”,只是记录一些我觉得有帮助的东西,希望做同样的事情的且同样不是那么牛逼的Linux学习者们有用:)

虽说是WordPress搬家,但是任何一个小型网站搬家都差不多这样了吧,嘿嘿。

如果用cPanel和MySQLAdmin之类的东西可能就很傻瓜,但是第一cPanel太贵了(竟然要425多刀一年,我都笑了),第二VPS都买了必须必须要抓住每一个学Linux的机会啊。

过程如下(断断续续弄了好几天…):

环境

虚拟主机和VPS都是host2ez的,最牛逼的主机提供商。系统是CentOS Linux 5.6,apache(现在改名叫httpd)已经装好了,再装

yum php mysql mysql-server

就成。

文件

这个简单,cPanel把虚拟主机上文件打包,VPS上wget下来就好。WP的独立性做的好,文件路径改变不会有什么问题。备份用的插件BackUpWordpress倒因为出问题了,不能识别路径,我直接禁用掉了,VPS嘛马上弄个备份方案还不容易,不需要用WP的插件了。在[wordpress path]/wp_config.php里把信息改一下,数据库部分的怎么改见下面。

数据库

对数据库命令不了解的同学建议先看一下mysql的教程。我不能把所有操作都写出来…这次弄这个还学了不少数据库的东西…tutorial很容易搜到,我觉得有一个比较好的命令列表点 这里,里面包括了所有常用的命令。

在虚拟主机的cPanel – mysqladmin里备份出.sql文件,传上VPS,导入文件的命令是

mysql – u user_name -p database_name < file_name.sql

很多地方写的-p后面跟密码,我用的版本-p后面不跟东西,回车以后才提示输密码,可能是新版本不提倡显式输入密码了吧。非要用的话就–password=”xxxxxx”

如果你导出文件选的是整个mysql,需要打开文件把database”information_schema”部分删掉,否则会失败,这个db貌似是mysql自己的,不能改..不懂

之后要建立一个用户并给此用户分配使用相应db的权限,虽然我们也可以直接把root用户写进wp_config.php但是稍微有点安全意识的程序员都不会想要这么做的…虽然权限没什么大不了的,但是名字叫root就是不行! 所以进数据库:

mysql -u root -p

进去以后添加用户:

mysql> create user 'username'@'localhost' identified by 'mypass';

分配权限:

mysql> grant all privileges on databasename.* to username@localhost;
mysql> flush privileges;

然后就把这个用户甩给Wordpress啦(编辑wp_config.php)

测试的时候有一些问题

上面完了就能http进vps的ip看到博客了,但是不要去点任何东西…因为数据库里“本站”的地址还是原来的域名,这样如果你原来的网站还开着那么随便点个链接就进到原来网站了,如果没开那就can’t find page啦。

而且因为没法进后台改,所以只好进mysql改了

mysql> use viaxlcom_viaxlcom;
mysql> select * from wp_options where option_value rlike "^http";
+-----------+---------+-------------+----------------------------+----------+
| option_id | blog_id | option_name | option_value               | autoload |
+-----------+---------+-------------+----------------------------+----------+
|         2 |       0 | siteurl     | http://axlarts.com/blog      | yes      |
|        39 |       0 | home        | http://axlarts.com           | yes      |
|        41 |       0 | ping_sites  | http://rpc.pingomatic.com/ | yes      | 
+-----------+---------+-------------+----------------------------+----------+
3 rows in set (0.06 sec)
update wp_options set option_value="http://12.34.56.78/blog" where option_id=2;
update wp_options set option_value="http://12.34.56.78" where option_id=39;

这样就把VPS上的网站地址改成本身的IP了。

————————————-
另外我发现一些插件会出现权限问题,比如JW player(放flv视频用的插件),没法启用插件因为提示不能写目录,我整个www目录都是755权限,设置成777以后可以开启了,然后再弄回来。这个问题解决了但是原因一直不知道,直到我因为另一个问题搜了一下才搞明白。

另一个问题是:更新插件update的时候会提示我输入ftp帐号,以前没这事啊,于是我就去装了个vsftpd(ftp的服务端),设置好能更新了,但是为什么?后来搜到这篇文章 <Auto Update WordPress Without FTP> 解决了ftp的问题并且意识到上面的问题也和这个有关系,即因为目录的owner不是httpd,所以网站脚本没有对文件操作的权限。

/var/www目录的owner要设置成httpd的运行者(可以用ps aux或者top命令查看),可能是www,apache或者nobody或者其他的。我的是apache,所以在chown apache:apache /var/www -R之后update就不用输ftp了,我立刻关了vsftpd依然ok,可见之前是绕了弯子了,没权限还用ftp操作文件…

绑域名

进godaddy面板直接改A地址就好了,没有别的要操作的。

但是因为我本来虚拟主机上就放了两个网站,所以怎么在一个VPS上绑定多个域名多个网站?之前用cPanel是傻瓜操作,没有怎么弄?这个我也弄了好半天最终解决了,马上再写一篇单独说吧

好啦好啦,到此结束,路人有问题可以在下面留言~

24,280 thoughts on “网站/WordPress从虚拟主机搬家到VPS上

  1. true_lyKi

    Designed with players in the United Kingdom in mind, the site keeps registration and play simple.
    Fans of live gaming can join real-dealer tables running 24 hours a day.
    True Fortune greets new users in the United Kingdom with a welcome package that boosts the first deposit.
    true fortune 50 free spins promo code true fortune 50 free spins promo code
    True Fortune supports popular payment methods including Visa, Mastercard and e-wallets like Skrill and Neteller.
    A valid licence and secure infrastructure make True Fortune a safe place to play.
    A 24/7 support team helps players in the United Kingdom through live chat and email.

    Reply
  2. true_dxml

    In the United Kingdom, True Fortune casino stands out as a trusted online gambling destination.

    A dedicated live casino streams real-dealer roulette, blackjack and baccarat around the clock.

    True Fortune greets new users in the United Kingdom with a welcome package that boosts the first deposit.

    Fast, transparent withdrawals mean winnings reach players without long delays.

    True Fortune operates under an official licence and uses SSL encryption to protect player data.

    True Fortune works seamlessly on smartphones and tablets straight from the browser.

    true fortune casino no deposit bonus free chips usa true fortune casino no deposit bonus free chips usa

    Reply
  3. mostbet_kiSa

    Беттеры, отзовитесь кто откуда. Вечно то лаги на сайте в самый ответственный момент, Денег слил на всяком говне и нечестных букмекерах до тех пор, не протестировал единственное место, где реально не кидают и предлагает топовые условия как для ординаров, так и для экспрессов. Техподдержка в лайв-чате отвечает сразу по делу,

    Кому тоже актуально найти проверенное место для игры, смотрите сами все условия по ссылке онлайн билет футбол онлайн билет футбол Данный сервис сейчас реально рулит на рынке, обязательно перешлите этот пост тому, кто тоже сейчас ищет нормальную контору!

    Reply
  4. true_uvpt

    True Fortune casino has become a go-to online casino for many players in the United Kingdom.

    The live casino section brings authentic tables with professional dealers straight to any device.

    Every wager earns loyalty points that can be exchanged for bonus credit.

    the true casino the true casino

    The casino accepts a range of payment options familiar to players in the United Kingdom.

    The site offers deposit limits, reality checks and self-exclusion for safer play.

    The mobile casino runs smoothly in any browser with no download required.

    Reply
  5. true_zoet

    In the United Kingdom, True Fortune casino stands out as a trusted online gambling destination.

    True Fortune regularly adds new titles and jackpot games to the lobby.

    Every wager earns loyalty points that can be exchanged for bonus credit.

    The casino aims to process cashouts fast, especially for verified accounts.

    All games run on certified random number generators for provably fair results.

    A 24/7 support team helps players in the United Kingdom through live chat and email.

    true fortune no deposit bonus codes 2025 true fortune no deposit bonus codes 2025

    Reply
  6. 888starz_rcOl

    In Egypt, the official 888starz platform unites online casino and sports betting in one place.

    The 888starz casino features more than 5000 games from top providers like Pragmatic Play, NetEnt and Microgaming.

    888starz offers betting on over fifty sports including football, tennis, basketball and esports.

    Weekly promotions are available, including 50% cashback and insurance on bets.

    The official site provides flexible payments including cards, wallets and crypto with deposits from just 5 dollars.

    888starz 888starz

    Reply
  7. true_xyOi

    True Fortune is tailored to players in the United Kingdom, with familiar payment methods and clear terms.

    The game library includes thousands of titles, from classic fruit machines to modern video slots.

    First-time players receive a welcome bonus plus free spins after signing up.

    Deposits and withdrawals can be made with cards, e-wallets and bank transfer.

    True Fortune promotes responsible gaming with limits, time-outs and support links.

    A detailed FAQ and clear terms make it easy for players in the United Kingdom to find answers fast.

    true fortune casino reviews true fortune casino reviews

    Reply
  8. 888starz_toml

    888starz apk 888starz

    The apk file can be downloaded directly onto Android devices in a few simple steps.

    The app installs quickly so the user can open it right away.

    The Android version is compatible with most phones, including lower-spec models.

    The permissions requested by the app should be reviewed before completing installation.

    iOS users get the app in an easy and direct way on their device.

    Reply
  9. mostbet_jykl

    Слушайте, кто сейчас в теме? То выплаты выигрышей задерживают по двое суток, Нервов потратил на этих конторах — мама не горюй пока чисто случайно не нашел наконец толковую рабочую платформу, начиная от удобного интерфейса и заканчивая официальной лицензией. Всё летает как часы в любое время суток,

    Кому тоже актуально найти проверенное место для игры, жмите на источник, чтобы случайно не потерять контакты мостбет контора мостбет контора Не ведитесь на дешевые лохотроны из рекламы, обязательно перешлите этот пост тому, кто тоже сейчас ищет нормальную контору!

    Reply
  10. mostbet_txor

    Слушайте, кто сейчас в теме? А служба поддержки молчит как рыба и не отвечает. Искал реально долго, перепробовал кучу сомнительных вариантов пока чисто случайно не протестировал единственное место, где реально не кидают и предлагает topoвые условия как для ординаров, так и для экспрессов. Вывод честно заработанных денег занимает буквально 5 минут,

    Кому тоже актуально найти проверенное место для игры, там расписаны все технические подробности ставки сайт https://mostbet-jdl.com.kg Не ведитесь на дешевые лохотроны из рекламы, обязательно перешлите этот пост тому, кто тоже сейчас ищет нормальную контору!

    Reply
  11. true_krol

    The site combines a huge game library with a clean, modern interface.

    Progressive jackpots and top-rated new releases are highlighted in the casino lobby.

    Frequent players climb a VIP ladder that unlocks better rewards and faster withdrawals.

    The casino accepts a range of payment options familiar to players in the United Kingdom.

    Certified RNG technology ensures every spin and hand is completely random.

    Clear rules and a well-organised help centre keep everything straightforward.

    true fortune casino no deposit codes true fortune casino no deposit codes

    Reply
  12. 888starz_ehml

    The app has a small size that does not take up much phone memory.

    The app installs as soon as the apk file is opened and the steps are confirmed.

    The Android app offers a stable experience and an easy-to-use interface across devices.

    The permissions requested by the app should be reviewed before completing installation.

    The iOS version offers the same performance as the Android one with an interface refined for Apple devices.

    888starz 888starz

    Reply
  13. true_tgka

    True Fortune casino has become a go-to online casino for many players in the United Kingdom.

    Live blackjack, roulette and game shows are available at any time of day.

    First-time players receive a welcome bonus plus free spins after signing up.

    Minimum deposits are low, making it easy to get started.

    The casino is licensed and applies strong security to keep accounts and funds safe.

    A 24/7 support team helps players in the United Kingdom through live chat and email.

    casino true casino true

    Reply
  14. true_wpKr

    Everything from slots to live tables is available on the official True Fortune site.

    The True Fortune casino features thousands of slots from leading providers like Pragmatic Play, NetEnt and Play’n GO.

    First-time players receive a welcome bonus plus free spins after signing up.

    Topping up an account is instant with no fees on most payment methods.

    All games run on certified random number generators for provably fair results.

    The support team responds quickly via chat and email at any hour.

    true fortune casino 50 free chip code true fortune casino 50 free chip code

    Reply
  15. 888starz_hkOl

    The 888starz apk is available for direct download on Android phones with ease.

    Installing the apk finishes in a short time, making the app ready instantly.

    The Android version is compatible with most phones, including lower-spec models.

    It is always recommended to download the apk from the official source to avoid modified or unsafe versions.

    The iOS version delivers a smooth, stable experience matching the Android edition.

    888starz 888starz apk

    Reply
  16. true_zfKi

    True Fortune casino has become a go-to online casino for many players in the United Kingdom.
    Big-money jackpots and trending games are easy to find on the homepage.
    New players in the United Kingdom can claim a generous welcome bonus with free spins on their first deposit.
    true fortune no deposit bonus true fortune no deposit bonus
    True Fortune supports popular payment methods including Visa, Mastercard and e-wallets like Skrill and Neteller.
    Players in the United Kingdom can use built-in tools to keep their gambling under control.
    Customer support is available around the clock via live chat and email in English.

    Reply
  17. true_buml

    True Fortune casino is one of the most popular online casinos among players in the United Kingdom.

    Big-money jackpots and trending games are easy to find on the homepage.

    The promotions page lists reload bonuses, tournaments and cashback offers.

    Adding funds takes just a moment and play begins straight away.

    True Fortune promotes responsible gaming with limits, time-outs and support links.

    True Fortune works seamlessly on smartphones and tablets straight from the browser.

    true fortune casino no deposit free chip true fortune casino no deposit free chip

    Reply
  18. 888starz_psml

    888starz apk 888starz

    Users can obtain the apk file and install it on an Android device without hassle.

    To install the apk on Android, first enable installation from unknown sources.

    The Android version of the 888starz app stands out for its speed and comfortable design.

    Updating the app periodically ensures a safer, more stable experience for the user.

    The 888starz app is also available for iPhone on iOS with the same ease of use.

    Reply
  19. true_qpet

    In the United Kingdom, True Fortune casino stands out as a trusted online gambling destination.

    The lobby showcases jackpot slots and the latest releases right at the top.

    Every wager earns loyalty points that can be exchanged for bonus credit.

    Withdrawals are handled quickly, with e-wallet payouts often completed the same day.

    Players in the United Kingdom can use built-in tools to keep their gambling under control.

    New users can check the FAQ for quick guidance on bonuses and payments.

    true fortune promo codes true fortune promo codes

    Reply
  20. 888starz_zqEl

    Users can obtain the apk file and install it on an Android device without hassle.

    After downloading the file, simply tap it and wait for the installation to complete automatically.

    The Android version of the 888starz app stands out for its speed and comfortable design.

    Keeping the app regularly updated helps close any gaps and raises the security level.

    Installation on iOS is straightforward and needs no extra settings.

    888starz apk 888starz apk

    Reply
  21. 888starz_edml

    The platform is licensed internationally, ensuring full protection of player accounts.

    888starz showcases top-rated and newly added games within the casino lobby.

    Strong odds and live betting come with instant updates on results and statistics.

    The official 888starz site gives new players in Uzbekistan a welcome package of up to 1500 euros with 150 free spins.

    888starz offers various deposit options from cards to digital wallets and more than 30 cryptocurrencies.

    888starz 888starz apk

    Reply
  22. true_qiei

    True Fortune gathers slots, table games and live dealers in one convenient place.

    Live blackjack, roulette and game shows are available at any time of day.

    Frequent players climb a VIP ladder that unlocks better rewards and faster withdrawals.

    True Fortune supports popular payment methods including Visa, Mastercard and e-wallets like Skrill and Neteller.

    The site offers deposit limits, reality checks and self-exclusion for safer play.

    The mobile casino runs smoothly in any browser with no download required.

    true fortune promo code true fortune promo code

    Reply
  23. 888starz_yiPa

    The 888starz application has spread quickly among smartphone owners in Egypt.

    The app installs quickly so the user can open it right away.

    The Android version of the 888starz app stands out for its speed and comfortable design.

    Keeping the app regularly updated helps close any gaps and raises the security level.

    The iOS version offers the same performance as the Android one with an interface refined for Apple devices.

    888starz apk 888starz apk

    Reply
  24. true_qqei

    True Fortune is tailored to players in the United Kingdom, with familiar payment methods and clear terms.

    The live casino section brings authentic tables with professional dealers straight to any device.

    The promotions page lists reload bonuses, tournaments and cashback offers.

    The casino accepts a range of payment options familiar to players in the United Kingdom.

    A valid licence and secure infrastructure make True Fortune a safe place to play.

    True Fortune works seamlessly on smartphones and tablets straight from the browser.

    true fortune casino $50 free chip true fortune casino $50 free chip

    Reply
  25. true_xgol

    True Fortune is tailored to players in the United Kingdom, with familiar payment methods and clear terms.

    Live blackjack, roulette and game shows are available at any time of day.

    A welcome offer with matched bonus funds and free spins awaits new players in the United Kingdom.

    Deposits and withdrawals can be made with cards, e-wallets and bank transfer.

    Responsible gambling tools let players set deposit limits, take breaks or self-exclude.

    A 24/7 support team helps players in the United Kingdom through live chat and email.

    100 free spins promo codes for true fortune casino 100 free spins promo codes for true fortune casino

    Reply
  26. true_qupt

    The casino welcomes players from the United Kingdom with a localised experience and responsive support.

    Big-money jackpots and trending games are easy to find on the homepage.

    A loyalty programme rewards active players with points that convert into real bonuses.

    true fortune casino sister sites no deposit bonus true fortune casino sister sites no deposit bonus

    Withdrawals are handled quickly, with e-wallet payouts often completed the same day.

    Certified RNG technology ensures every spin and hand is completely random.

    The mobile casino runs smoothly in any browser with no download required.

    Reply
  27. true_hska

    True Fortune gathers slots, table games and live dealers in one convenient place.

    The game library includes thousands of titles, from classic fruit machines to modern video slots.

    A welcome offer with matched bonus funds and free spins awaits new players in the United Kingdom.

    Deposits and withdrawals can be made with cards, e-wallets and bank transfer.

    The casino is licensed and applies strong security to keep accounts and funds safe.

    A 24/7 support team helps players in the United Kingdom through live chat and email.

    true fortune casino free chip true fortune casino free chip

    Reply
  28. true_gqKr

    True Fortune gathers slots, table games and live dealers in one convenient place.

    A dedicated live casino streams real-dealer roulette, blackjack and baccarat around the clock.

    Frequent players climb a VIP ladder that unlocks better rewards and faster withdrawals.

    Withdrawals are handled quickly, with e-wallet payouts often completed the same day.

    The casino is licensed and applies strong security to keep accounts and funds safe.

    The site is fully responsive, adapting to any screen size on the go.

    true fortune casino free spins true fortune casino free spins

    Reply
  29. 888starz_mkEl

    Users can obtain the apk file and install it on an Android device without hassle.

    Installing the apk finishes in a short time, making the app ready instantly.

    The 888starz app for Android delivers fast performance and a smooth, mobile-optimized interface.

    Updating the apk continuously helps improve security and patch potential vulnerabilities.

    Installation on iOS is straightforward and needs no extra settings.

    888starz apk 888starz apk

    Reply
  30. true_jwOi

    The official True Fortune casino has built a strong reputation with players across the United Kingdom.

    The True Fortune casino features thousands of slots from leading providers like Pragmatic Play, NetEnt and Play’n GO.

    First-time players receive a welcome bonus plus free spins after signing up.

    True Fortune supports popular payment methods including Visa, Mastercard and e-wallets like Skrill and Neteller.

    Independent audits confirm the games are fair and payouts are genuine.

    A detailed FAQ and clear terms make it easy for players in the United Kingdom to find answers fast.

    true fortune free spins no deposit true fortune free spins no deposit

    Reply
  31. true_vlei

    The official True Fortune casino has built a strong reputation with players across the United Kingdom.

    The live casino section brings authentic tables with professional dealers straight to any device.

    A welcome offer with matched bonus funds and free spins awaits new players in the United Kingdom.

    Players can fund their account via cards, digital wallets and modern payment services.

    Players in the United Kingdom can use built-in tools to keep their gambling under control.

    New users can check the FAQ for quick guidance on bonuses and payments.

    truefortune casino bonus code truefortune casino bonus code

    Reply
  32. 888starz_zuPa

    The 888starz application has spread quickly among smartphone owners in Uzbekistan.

    To install the apk on Android, first enable installation from unknown sources.

    The app runs efficiently even on mid-range devices without lag.

    Updating the apk continuously helps improve security and patch potential vulnerabilities.

    The 888starz app is also available for iPhone on iOS with the same ease of use.

    888starz apk 888starz apk

    Reply
  33. mostbet_hiEi

    Народ, кто реально ставит? Задолбался я уже искать нормальную контору для ставок, Денег слил на всяком говне и нечестных букмекерах пока чисто случайно не нашел наконец толковую рабочую платформу, начиная от удобного интерфейса и заканчивая официальной лицензией. Вывод честно заработанных денег занимает буквально 5 минут,

    В общем, если не хотите тратить время на самостоятельные тесты, вся полезная инфа выложена вот здесь билет футбол билет футбол Не ведитесь на дешевые лохотроны из рекламы, обязательно перешлите этот пост тому, кто тоже сейчас ищет нормальную контору!

    Reply
  34. true_njpt

    True Fortune is tailored to players in the United Kingdom, with familiar payment methods and clear terms.

    True Fortune offers an extensive range of slots covering every theme and volatility level.

    Every wager earns loyalty points that can be exchanged for bonus credit.

    true fortune casino no deposit bonus codes 2025 true fortune casino no deposit bonus codes 2025

    The casino aims to process cashouts fast, especially for verified accounts.

    Fair play is guaranteed by independently tested RNG games with published RTP rates.

    Clear rules and a well-organised help centre keep everything straightforward.

    Reply
  35. true_gqei

    The site combines a huge game library with a clean, modern interface.

    Fans of live gaming can join real-dealer tables running 24 hours a day.

    Players enjoy recurring promotions including cashback and free spins on selected slots.

    Verified players enjoy speedy payouts through their preferred method.

    Fair play is guaranteed by independently tested RNG games with published RTP rates.

    Transparent terms and a helpful FAQ section cover deposits, bonuses and withdrawals.

    true fortune casino home true fortune casino home

    Reply
  36. true_vwOi

    The casino welcomes players from the United Kingdom with a localised experience and responsive support.

    Big-money jackpots and trending games are easy to find on the homepage.

    The VIP scheme gives loyal users cashback boosts, gifts and a personal manager.

    Withdrawals are handled quickly, with e-wallet payouts often completed the same day.

    The casino is licensed and applies strong security to keep accounts and funds safe.

    Players can enjoy the full game library on mobile without installing an app.

    free spins promo codes for true fortune casino no deposit free spins promo codes for true fortune casino no deposit

    Reply
  37. true_oySn

    Designed with players in the United Kingdom in mind, the site keeps registration and play simple.

    True Fortune offers an extensive range of slots covering every theme and volatility level.

    Frequent players climb a VIP ladder that unlocks better rewards and faster withdrawals.

    Fast, transparent withdrawals mean winnings reach players without long delays.
    True Fortune operates under an official licence and uses SSL encryption to protect player data.
    true fortune casino no deposit promo codes for existing players 2026 true fortune casino no deposit promo codes for existing players 2026
    A detailed FAQ and clear terms make it easy for players in the United Kingdom to find answers fast.

    Reply
  38. true_ngKi

    Everything from slots to live tables is available on the official True Fortune site.
    True Fortune offers an extensive range of slots covering every theme and volatility level.
    The VIP scheme gives loyal users cashback boosts, gifts and a personal manager.
    true fortune no deposit code true fortune no deposit code
    Minimum deposits are low, making it easy to get started.
    True Fortune promotes responsible gaming with limits, time-outs and support links.
    Players can enjoy the full game library on mobile without installing an app.

    Reply
  39. true_qqKa

    True Fortune casino has become a go-to online casino for many players in the United Kingdom.
    Big-money jackpots and trending games are easy to find on the homepage.
    Ongoing offers such as weekly cashback and reload deals keep the balance topped up.
    The casino aims to process cashouts fast, especially for verified accounts.
    true fortune free 250 chip true fortune free 250 chip
    The casino is licensed and applies strong security to keep accounts and funds safe.
    Transparent terms and a helpful FAQ section cover deposits, bonuses and withdrawals.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *