Migrate Ghost from the SQLite3 database to the MySQL database _mysql

Source: Internet
Author: User
Tags mysql in

Let's say how to migrate from SQLite to MySQL.

Get ready

First, you have to install the MySQL database. If you are using an Ubuntu system, please refer to this article. Other systems please refer to their respective documentation.

Export Current Data

Enter Http://your-domain.com/ghost/debug page:

Click on the blue button to export all the data in the current database and download it locally, the default filename is Ghostdata.json.

Switch Database configuration

Edit the Config.js file and modify the database configuration to MySQL in the Production configuration section:

JavaScript database: { 
client: ' MySQL ', connection: {host: ' localhost ',///Database Server User: ' Database login ', password: ' Database login password ', DB: ' Database name ', CharSet: ' UTF8 '}, debug:false},

After completing the above fields, restart Ghost.

Import data

Because of the replacement of the database, there is no content in the new MySQL database, there is no login account, then we need to create a new temporary account, and then log into the Http://your-domain.com/ghost/debug Pages, such as the above, re-import the data that you exported earlier.

Reopen your Site page again, whether the original data are back!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.