Skip to main content
8 votes
Accepted

Automated deployment with content migrations and structural changes

Something I wish I knew a long time ago, as it has bitten us quite a few times already in the past. Nothing as bad as having an automated deployment process that fails once in a while. I'm sharing it ...
Tim Bertens's user avatar
7 votes
Accepted

Craft 3: Update database after CMS upgrade via console command

You can use Yii's migrate console command. Triggered in Craft 3 via craft migrate --type=app.
Brad Bell's user avatar
  • 67.5k
7 votes
Accepted

DB CPU running at 100%, Pages Never Load, Moving from MySQL to MariaDB

You're likely running into an issue seen with recent versions of MariaDB (10.6 and later), where importing an SQL dump can result in indexes not being created properly. Essentially, this will make ...
Mats Mikkel Rummelhoff's user avatar
6 votes

Programatically Adding Fields to a Layout

While I am adding them from a plugin, I ran into a similar issue as you, and like you, I didn't like the "recreate the layout from scratch" method the linked answer used. I know this question is old, ...
Shauna's user avatar
  • 181
6 votes

What's the best practice for handling data migration and organization across development environments?

I'm currently implementing a workflow that's very efficient for us. The trick is to use Backup Pro to "backup" locally and then "restore" once the site is deployed. This essentially version controls ...
SteveO's user avatar
  • 336
6 votes
Accepted

Moving from staging (MAMP) to live production server

Everything looks good to go more or less, but #4 can be improved upon by creating a multi-environment config file. This way, instead of having to change your site urls and base path (for assets) in ...
Ryan's user avatar
  • 1,952
6 votes
Accepted

Running module migrations

Per the Modules vs. Plugins docs, only plugins get their own migration track. Modules are considered part of the project (like templates and config files), so if there are any DB changes that need to ...
Brandon Kelly's user avatar
5 votes

How do I import data into Craft?

It's not mentioned above, but in my experience the FeedMe plugin is by far the best way to import content.
Nathan D Huening's user avatar
5 votes
Accepted

Migrating Craft site to another server --- throws 404 for all pages but homepage

99% chance that it is because the .htaccess file did not come over when you copied the files, as it is a hidden file. Copy that over to your new webroot and those interior pages should properly work.
Patrick Harrington's user avatar
5 votes

Migration of Craft CMS from one host to another

The accepted answer is a good one, but I thought I'd add something as food for thought. If you set up your workflow such that: All of your Craft CMS project is checked into a git repo and deploy it ...
andrew.welch's user avatar
  • 11.6k
5 votes
Accepted

Importing members from EE without password reset

It would be possible to write a plugin that provides an alternative login controller action, based on UsersController::actionLogin(). The difference would be that, if normal login fails, it could try ...
Brandon Kelly's user avatar
5 votes
Accepted

Has someone figured out Craft 3 content migrations?

For now (when the docs are not ready) you look into the craft source how things are saved for example: https://github.com/craftcms/cms/blob/develop/src/controllers/FieldsController.php#L250 Based on ...
Jeroen's user avatar
  • 308
5 votes

Has someone figured out Craft 3 content migrations?

This is a plugin I'm working on to do exactly what you are after. https://m.youtube.com/watch?v=n6ko2PKUqAo&feature=youtu.be The syntax to figure out how to create sections, elements etc is ...
Derrick Grigg's user avatar
5 votes

Migrate path from 2 to 3?

The documentation posts this link: Upgrading from Craft 2 Mijingo has a tutorial: Upgrading Craft 2 to Craft 3 There is a hangout on the topic on Straight Up Craft: Migrating a website with plugins ...
Ben Parizek's user avatar
  • 13.5k
5 votes
Accepted

Error clearing a field via migration script

I figured it out. I'm not sure understand the why of it. But here is the how: $product->setFieldValue('components', []); Craft::$app->elements->saveElement($product); I guess setFieldValue()...
Tony DeStefano's user avatar
5 votes

Migrating from Craft CMS to WordPress

It’s likely possible but would be tricky, since Craft has much more flexible content modeling features than WP. It would be a “lossy” conversion process, similar to converting a WAV file to a low ...
Brandon Kelly's user avatar
4 votes

Has someone figured out Craft 3 content migrations?

"I'm just having a hard time figuring out what options there are." The options are virtually limitless. You can put almost anything you want into a safeUp method. Craft 3 is still in beta, and ...
Lindsey D's user avatar
  • 24k
4 votes
Accepted

Down Migrations

The main reason down migrations aren't officially supported is because of the additional support overhead they would incur. Just one simple example: a down migration would have to "undo" what the up ...
Brad Bell's user avatar
  • 67.5k
4 votes

How can I export or move content from one Craft system into another? (with exactly the same configuration)

This can be a challenging situation. Craft content can be highly relational which makes it tricky to just export and re-import. Scenario 1: If your database and your clients database were both ...
Ben Parizek's user avatar
  • 13.5k
4 votes

Migrating my Blogger site to CraftCMS

I migrated a Blogger site by writing a Craft plugin to parse Blogger's XML and save images, posts, and categories into the Craft setup established with the client. The challenge with Craft is that ...
Matt Stein's user avatar
  • 4,006
4 votes
Accepted

Macro _self no longer possible in Craft 3

You have to import the macro {# include the richtext macro on multiple occasion into another macro #} {% macro memberMolecule( entryParam ) %} {% import _self as macro %} {{ macro....
Robin Schambach's user avatar
4 votes
Accepted

Is it possible to import orders into Craft Commerce?

Sprout Import supports importing Craft Commerce Orders on Craft 3. I can't speak to which fields are required off of the top of my head but importing to custom fields, variants, and even custom ...
Ben Parizek's user avatar
  • 13.5k
4 votes
Accepted

Upgrade to Craft 4

To upgrade to Craft 4, you'll need to make sure that Composer is allowed to upgrade all of your plugins to their Craft 4 compatible releases as well. This is done by manually editing your installed ...
Mats Mikkel Rummelhoff's user avatar
3 votes

Going from a static site generator (Jekyll or Hugo) to Craft CMS; Export/migrations options?

There is a good plugin called FeedMe that can help with imports. We used it migrating a pretty large EE site without issue. If you can spit out a XML, RSS, ATOM or JSON feed, it should be able to ...
AbbeyDesign's user avatar
  • 1,527
3 votes

Has someone figured out Craft 3 content migrations?

I've written up an article with some basic examples of content migrations in Craft 3: https://medium.com/@mikethehud/craft-cms-3-content-migration-examples-3a377f6420c3 As others have stated I just ...
mikethehud's user avatar
3 votes

Migrate WordPress Site into Craft CMS. How deal with 404's?

David, I like using Reroute. It's a Craft plugin that lets you create 301s and 302s to any of your entry pages within Craft.
Tim Knight's user avatar
  • 1,022
3 votes

What's the best practice for handling data migration and organization across development environments?

This came up today, so I figured I'd post for completeness. This is how I handle it: Database & Asset Syncing Between Environments in Craft CMS
andrew.welch's user avatar
  • 11.6k
3 votes
Accepted

Database structure for Craft 3 to import from external source?

I think you have to know what you need and what you want to achieve. You need to decide if you want to add elements or records because there is a huge difference between those two types of objects and ...
Robin Schambach's user avatar
3 votes

Update Asset Index in Migration

As of 3.1.2 you can now index assets via the cli tool: ./craft index-assets/all OR ./craft index-assets/one {handle}
Tony DeStefano's user avatar
3 votes
Accepted

Visiting admin brings up the installer

Sounds like it's viewing the DB as being empty. The access credentials are correct (it's technically connecting to the database), but it's not seeing any tables in the database. Does your site use a ...
Lindsey D's user avatar
  • 24k

Only top scored, non community-wiki answers of a minimum length are eligible