49

My general approach for this, not just with Craft, but with all CMSes is to have a shared database for development. It's not the most ideal solution, since there can be overwriting of work, but it at least prevents schema changes from having to be redone across multiple environments. Once a site goes live, maintaining a dev environment alongside live ...


17

Hmm. I started out having a feeling existing tools might be a best approach here. I soon found that even with the better of these, except for in-dev patching, we may want to wait for a Craft capability for transferring any less than a full dump of data in a Craft database. Syncing databases is a tricky problem, unless they are of exactly the same structural ...


17

There is craftimport which is an 'unsupported' starting point for importing entries from an XML source. https://github.com/clearbold/craftimport There is also Import: https://github.com/boboldehampsink/import which can import from CSV sources. Check out http://straightupcraft.com/craft-plugins for a list of current Craft plugins.


16

At this point in time, you have a few options: Import Plugins As of this post, there are a few partial import plugins available and rumors that a few others might be on their way. Sprout Import - Sprout Import supports over 40 data types such as Entries, Users, Assets, Products, Orders, Forms, Email, and Redirects; and more can be added as needed via ...


15

If you’re comfortable with PHP, Craft has some plugin APIs that make creating content relatively painless. For example, EntriesService::saveEntry().


11

Here is how I did it on a recent project: Create a temporary WP site to work in: I installed WP locally, imported the database, and downloaded the wp-content/uploads folder. You don't need the theme or any plugins (unless they affect the content output). In the Reading section of the WordPress settings, change "blog pages show at most" to a number higher ...


11

As far as ExpressionEngine goes, it looks like Mark Reeves has cooked up a starter plugin for that purpose. Bob Olde Hampsink made an import plugin as well that works with CSV's.


11

Note: This method is not for the faint of heart and might not be for everybody, but can be useful in some situations. One thing we do (at Airtype Studio, where I work) for larger installations is set up a couple of load-balanced pools of servers: an app tier and a web tier. In fact, the environment architecture is very similar to this: This type of ...


10

Make sure both Craft installs are up-to-date. Craft's license is saved in craft/config/license.key, make a backup of your purchased license file. Move all your files/directories except: /craft/app/ /craft/storage/ Copy the backup of your license.key to craft/config/. Remove /craft/storage/, if it exists on your new server, to prevent cache errors. "...


10

Most likely wherever Apache/PHP is configured to save session files doesn't exist or isn't writable. If you've got the overridePhpSessionLocation config setting set to true, then that will be in craft/storage/runtime/sessions folder.


9

I work with git for all my projects, I had to spend some time figuring out how to set up the folders and files, i.e.: what to gitignore. But it now works pretty well. All the core files are independent from the configuration/assets so it's pretty easy to work with once it's been setup. Now, in regards to the database, I have been working with separate, ...


8

I found a great blog post where the author uses Phinx and MySQL Query Log to create database migrations. I summarized its content into 10 easy steps: Step 1 Enable the MySQL Query Log on your dev environment by editing your mysql my.cnf file. Set the general_log key to 1 and general_log_file to /var/log/mysql/mysql.log Step 2 Take a snapshot of your ...


8

We currently handle this with database dumps from dev and taking screenshots of config screens and attaching them to git pull requests. There needs to be a better way though. The only CMS that has any kind of solution that I know of to this problem is Wordpress with this plugin https://deliciousbrains.com/wp-migrate-db-pro/


7

You can use Yii's migrate console command. Triggered in Craft 3 via craft migrate --type=app.


6

The object of migrations is to provide a way for existing installations of your plugin to get the updated db schema as you update your plugin, without having to uninstall (which would mean they would lose all plugin data) and then reinstall your plugin. If your schema changes over the life of your plugin, you can write a migration to keep existing ...


6

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 the event you want to overwrite your local db with your live site db to sync it up, you just use a variable in the CMS like {siteUrl} or {basePath} that's set in ...


5

It's not mentioned above, but in my experience the FeedMe plugin is by far the best way to import content.


5

That's a bug in our RedactorClips plugin, actually. Just fixed it, so if you grab the latest from here (https://github.com/pixelandtonic/RedactorClips), yiic still should run fine.


5

If you're just trying to migrate data, the most simple method would be to use a WordPress plugin to export your posts to a CSV and import it into Craft using this Import Plugin by Bob Olde Hampsink. This is just for posts. I'm not sure what you would do for pages, since we have a special section type for those. A WordPress Import Plugin has not yet been ...


5

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, but it seems the most apt place to put my solution to this issue and contribute to more code samples. After some experimenting, I got a solution that works (...


5

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.


5

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 checking the old ExpressionEngine database to see if the user exists there, and if so, it could hash up the password in the same way EE does it, and see if it ...


5

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 determined by reading through the craft service and model classes.


5

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 from Craft 2 to Craft 3 At the time of this posting, I have not seen any good documentation on how Plugin Developers should approach migrating their plugins.


5

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 bitrate MP3. The best way to get content out of Craft is probably to use the Element API plugin. I couldn’t tell you how to get that content into WP though – you ...


4

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 the DB without lots of manual DB dropping and importing. Communication is very important with this method as Devs and Stakeholders need to be aware of how the ...


4

PluginNameRecord.php is how Craft installs database tables. You can also have multiple tables by using PluginName_TableRecord.php where 'Table' will be the name of the new table in the database. Might also be worthwhile to mention that the cocktails recipe you linked to has a lot of issues as it has not been updated for the latest versions of Craft. Sean ...


4

Go into Settings Click "Backup database", this will give you a .zip file of your data Go into phpMyAdmin of your production site Find your database, click Import Upload .zip file


4

If you're not already on a CMS, I'd recommend migrating to Craft sooner rather than later. Sounds like you're definitely planning on migrating to Craft, so I see no valuable reason to delay. Pros of migrating now: Awesome Craft features, like Matrix Plugins Twig Cons of migrating later: More legacy code to port More legacy data to restructure You'll ...


4

Actually, everything was working fine with the migration. The issue was that I had code inside of a Twig extension and inside of a rendering hook that was being executed before the migration tried to take place. I wrapped it in if (!craft()->request->isCpRequest()) to only do its thing when it's a non-CP request (which is how it probably should have ...


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