dtsjq28482 2017-09-18 19:58
浏览 73

如何将我的Heroku + MediaWiki数据库从clearDB更改为本地数据库

I build a wiki using MediaWiki. Initially, I used a remote database (clearDB), as setup was faster. I now want to migrate the data, and use a db local to the server instead.

My current db settings in Localsettings.php

## Database settings
$wgDBtype = "mysql";
$wgDBserver = "us-XXXX-XXXX-XXX-XX.cleardb.net";
$wgDBname = "heroku_XXXXXXXXX";
$wgDBuser = "XXXXXXXXX";
$wgDBpassword = "XXXXXXXXXX";

Obviously, if I just "changed" the $wgDBserver to localhost, it won't work.

What needs to be done to migrate the old data and default MediaWiki architecture to a new db local to the server?

  • 写回答

1条回答 默认 最新

  • duancheng3342 2017-09-18 20:06
    关注

    You would need to use mysqldump on your old data store and save the pure SQL locally.

    mysqldump -u <user> -p -h us-XXXX-XXXX-XXX-XX.cleardb.net heroku_XXXXXXXX > /tmp/wikidump.sql
    

    Then on your local server, recreate the heroku_XXXXXXXXX DB t

    CREATE DATABASE heroku_XXXXXXXX (exact same name);
    use heroku_XXXXXXX;
    source /tmp/wikidump.sql
    

    This will do the trick.

    I sometimes look inside the dump (/tmp/wikidump.sql) with a text editor to make sure no references to cleardb.net exists an change them. That's just me! Otherwise follow:

    Change external links

    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改