Tos Web Developer provides insights, tutorials, and advice around topics including content strategy, design, Drupal Development, Drupal Custom Module Development, Drupal 8 Custom themes, PHP, Server, Twig, and more


                                


   If you want to migrate content type form your stage server to the production server.
Install Drupal console on the server then you can easily export content-type and paragraph using the Drupal console if you did not install drupal console and Drush goto following and install drupal console and Drush.


 Drush Installation:- 

https://docs.drush.org/en/master/install/
https://medium.com/d6-digital/installing-drush-on-windows-10-for-drupal-8-22f7f7c38f2   (for windows user)

 Drupal Console installation:- 

https://drupalconsole.com/docs/en/getting/composer
https://www.drupal.org/docs/8/installing-and-configuring-the-drupal-console-with-windows-10-xampp (for windows user)


Once Install Drupal Console and Drush Successfully goto your project path using CMD 

 cd D:/Xampp/htdocs/drupal8   

Once you are in your project path Then Run the following command to export content type and paragraph type but before you start export you need to create a basic custom Drupal 8/9 module because once you run following content-type and paragraph type export cmd they export in your custom module folder so you can create as module otherwise you can collect this folder easily import any site.

Content-type export command using Drupal console

 drupal config:export:content:type <content_type_machine_name>  

Paragraph-type export command using Drupal console 

 drupal config:export:entity paragraphs_type <PARPAGRAPH_TYPE>  

After export all file you can import using Drush command and configuration manager 

Following steps to import content type and paragraphs type using Drupal Drush:

Step 1:- goto your site 

 sites/default/files/config_HASH 

 Path check sync folder if present then upload all exported YML file here 

Step 2:-  Once all uploaded file run import drupal command

 drush cim  

Once Successfully import all YML file structure > content type path check imported content.

I hope this article will helpful in migrating content types using the drupal console.  

No comments:

Post a Comment

| Designed And Blog Post by www.toswebdeveloper.com