Answers.Body: <p>For syncing your database in Craft 3 you can use the <a href="https://docs.craftcms.com/v3/project-config.html" rel="nofollow noreferrer">Project Config</a> please read the instructions in the link how to use it and what it does</p>
  
  <blockquote>
    <p>Once that’s enabled, Craft will start storing the project config in a config/project.yaml file. Any time something changes that is managed by the project config, that file will get updated to match. And any time Craft detects that project.yaml has been updated on its own (e.g. if it was changed in a Git commit that was recently pulled down), any changes in it will be propagated to the local Craft install.</p>
  </blockquote>
  
  <p>So store the file in your directory and Craft will do the rest</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-18T11:09:56.253Z
Answers.LastActivityDate: 2019-03-18T11:09:56.253Z
Answers.UserDisplayName: Robin Schambach
Body: <p>We have previously used the <code>Schematic</code> plugin for database import inside a <code>Docker</code> container for a Python script. This is the command used for the importing, </p>
  
  <pre><code>$/data/craft/craft schematic/export --file=schema.yml
  </code></pre>
  
  <p>The <code>/data/craft/craft</code> means we run the command inside the preceding folder and the command itself is <code>schematic/export --file=schema.yml</code>. The file <code>schema.yml</code> has the database definition.</p>
  
  <p>How do you import and export the databases using the Craft 3.1.x?  </p>
  
  <p>Now we use the <code>Craft 3.1</code> which doesn't work with the <code>Schematic</code>.  I have this project config file after we upgraded to the <code>Craft 3</code>, </p>
  
  <pre><code>dateModified: 1552904208
  plugins:
    aws-s3:
      edition: standard
      enabled: true
      schemaVersion: '1.2'
    redactor:
      edition: standard
      enabled: true
      schemaVersion: 2.2.2
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-18T10:58:24.820Z
Comments.Text: It depends what you want... do you want to import a database or do you want to sync settings such as sections/categories/product types? Craft has actually nothing to do with your DB interface. You can import a DB via mysql command. `mysql -u username -p database_name < file.sql`
Comments.UserDisplayName: Robin Schambach
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-18T11:05:43.810Z
Comments.Text: I would prefer to import and export for this task. However, it would be also great if you tell me how do I sync the settings as well.
Comments.UserDisplayName: Arefe
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-18T11:06:38.750Z
Comments.Text: We use the `MySQL` and `Postgresql` for the databases. So, I guess I will get a SQL file in the local machine after I import the database?
Comments.UserDisplayName: Arefe
Tags: <craft3><plugins><database>
Title: How do I import database using the CMS Craft 3
ThreadText: # How do I import database using the CMS Craft 3
  
  (Asked by: username_0 on 2019-03-18)
  
  We have previously used the `Schematic` plugin for database import inside a `Docker` container for a Python script. This is the command used for the importing,
  
  ```
  $/data/craft/craft schematic/export --file=schema.yml
  
  ```
  
  The `/data/craft/craft` means we run the command inside the preceding folder and the command itself is `schematic/export --file=schema.yml`. The file `schema.yml` has the database definition.
  
  How do you import and export the databases using the Craft 3.1.x?
  
  Now we use the `Craft 3.1` which doesn't work with the `Schematic`. I have this project config file after we upgraded to the `Craft 3`,
  
  ```
  dateModified: 1552904208
  plugins:
    aws-s3:
      edition: standard
      enabled: true
      schemaVersion: '1.2'
    redactor:
      edition: standard
      enabled: true
      schemaVersion: 2.2.2
  
  ```
  
  **Tags:** craft3, plugins, database
  
  > **Comments:**
  > **username_1**: It depends what you want... do you want to import a database or do you want to sync settings such as sections/categories/product types? Craft has actually nothing to do with your DB interface. You can import a DB via mysql command. `mysql -u username -p database_name < file.sql`  
  > **username_0**: I would prefer to import and export for this task. However, it would be also great if you tell me how do I sync the settings as well.  
  > **username_0**: We use the `MySQL` and `Postgresql` for the databases. So, I guess I will get a SQL file in the local machine after I import the database?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-03-18. Score: 2 | Accepted answer
  
  For syncing your database in Craft 3 you can use the [Project Config](https://docs.craftcms.com/v3/project-config.html) please read the instructions in the link how to use it and what it does
  
  > Once that’s enabled, Craft will start storing the project config in a config/project.yaml file. Any time something changes that is managed by the project config, that file will get updated to match. And any time Craft detects that project.yaml has been updated on its own (e.g. if it was changed in a Git commit that was recently pulled down), any changes in it will be propagated to the local Craft install.
  
  So store the file in your directory and Craft will do the rest
  
  
  ---
  
  