Upgrading Statamic from v2 to v3
Section titled “Upgrading Statamic from v2 to v3”This guide walks through upgrading a Statamic v2 site to v3. Before you start, read these two docs:
Step 1: Update Your v2 Site to the Latest Version
Section titled “Step 1: Update Your v2 Site to the Latest Version”Download the latest v2 release from the Statamic website. You’ll find it under the account where your license was purchased.
- Run
php please versionto check your current v2 version. - Download and extract the latest v2 release.
- Replace the existing
statamicfolder in your v2 project with the new one. - Run
php please update:housekeepingto finish the update.
Step 2: Migrate to v3
Section titled “Step 2: Migrate to v3”Create a new Statamic v3 site:
statamic new name-of-websiteInstall the migrator package:
composer require statamic/migrator --dev --with-all-dependenciesClear the new site’s default content. Check the content, blueprints, and trees folders for any references to existing collections and remove them before continuing.
php please site:clearCopy the assets, site, and any other local folders from your v2 installation into the new v3 site.
Commit everything to git before running the migration. This makes it easy to see exactly what changes.
Run the migration:
php please migrate:siteStep 3: Review the Migrated Site
Section titled “Step 3: Review the Migrated Site”After the migration runs, check the following:
- Assets - Confirm that assets load correctly in the layout file.
- Deprecated tags - Look for old tags like
entries,relate, andpagesand update them. - Routes - Check
web.phpand remove any routes that are no longer needed. - URL modifiers - Find any templates using
field_name | urland replace them withfield_name:url.