Why a SuiteCRM 7 to 8 migration stalls at the same few points
A migration command fails, or a retry leaves you unable to log in. Most stalls on the SuiteCRM 7 to 8 move come from four documented causes, and each one is quick to check once you know where to look. The first is the wrong package: the standard SuiteCRM 8 package was used where the migration package was needed. The second is folder placement, where files end up in the wrong location. The third is a CSRF token error after re-migrating to the same URL, usually caused by old session cookies. The fourth is file permissions left wrong after console commands were run as a user other than the web server user, such as root.
SuiteCRM documents this move as a migration into a new SuiteCRM 8 environment, not an in-place upgrade. That means the troubleshooting starts with one question: which package and which environment are you working in? Confirm that the SuiteCRM 7 instance has been brought to the latest 7.14.x or later, that you are running the migration package, and that the SuiteCRM 8 target is a fresh environment, as described in the SuiteCRM migration documentation. Checking these first avoids chasing symptoms that were caused by the setup itself.
The fixes are usually small: a correct package, a corrected path, cleared cookies and a permissions reset. The effort grows when the same URL is reused for repeated attempts, because stale sessions and partial data pile up, and when commands run as root leave files the web server cannot read. Before retrying, ask your team to record which package was used, where it was unpacked, which command ran and as which user. Those notes turn a multi-day cycle into a short, targeted fix.
How to work through a failed SuiteCRM 7 to 8 migration step
The diagram starts at the failed command and first asks whether the migration command exists. If it does not, the likely cause is the standard package, so the next check is the migration package name. When the target URL was used before, the path moves to a CSRF token check: refresh the page and clear browser cookies. After any command run as root, the last check is file ownership and resetting permissions for the web server user. Each branch ends in a documented check, not a guess.
Decision path for three documented SuiteCRM 7 to 8 migration failures.
Fixing the wrong package and folder placement in a SuiteCRM 7 to 8 migration
When the suitecrm:app:setup-legacy-migration command is missing, the most likely cause is that the standard SuiteCRM 8 package was used instead of the migration package. The migration package is named along the lines of SuiteCRM-8.7.0-7.14.x-migration, and it is the only archive that carries the console command the migration depends on. Before changing anything else, confirm which archive was extracted. Check the file name you downloaded, then check the installed application for the command by listing the available console commands and searching for the suitecrm:app namespace. If the command is absent from a directory you extracted from the standard package, the package is the problem, not the database or the configuration.
To fix it, download the migration package that matches your SuiteCRM 7 version from the SuiteCRM 8 migration known issues page, then extract it into a new, empty directory rather than overwriting the existing install. Keep the new directory separate from the SuiteCRM 7 instance so that old files do not mix with new ones. Also confirm the folder layout the console command expects, because the command only runs where the application root sits. Running it from a parent folder, a copied subfolder or a web server document root that points somewhere else produces errors that look like package problems. Confirm the exact layout against the SuiteDocs migration pages before you copy any data, since this paragraph does not supply a specific path. Record the directory you used so the team can repeat the steps on a staging instance.
Which symptom points to which cause
This table matches each SuiteCRM 7 to 8 migration symptom to its most likely cause and the first check to run. Read across each row and confirm the cause before you change files or data. Most of these errors trace back to the wrong package, leftover browser cookies, or the user that ran the console commands.
| Symptom | Usual cause | First check |
|---|---|---|
| Missing suitecrm:app:setup-legacy-migration command | Standard package used instead of the migration package | Confirm the package name includes migration, such as SuiteCRM-8.7.0-7.14.x-migration |
| Invalid CSRF token error after a second migration to the same URL | Old session cookies left over from the earlier attempt | Refresh the page, clear browser cookies for the site and sign in again |
| Permission errors after console commands | Upgrade commands run as root or another user, not the web server user | Check file ownership, then reset permissions for the web server user |
| Migration fails on customizations under public/legacy | Non-core files in public/legacy that the migration may remove | Back up files and database, review customizations and retest on a staging instance |
Repairing the target in place or starting over on a clean environment
Repairing in place keeps the existing SuiteCRM 8 target and corrects the specific fault, such as a wrong package, misplaced files, stale session cookies or ownership changes after a console command. It fits when the failed run was small, the cause is known, and the target holds no data you have not already accounted for. Because the same URL and database remain in use, leftover state carries forward unless you clear it deliberately.
- Leftover session state: Old cookies for the same URL can produce an Invalid CSRF token error. Clear browser cookies and refresh before retesting, and do not assume the fix is server-side.
- Changed file permissions: If upgrade or migration commands ran as root or another user, reset ownership and permissions to the web server user so the application can write its cache and files.
- Partial data: A half-finished data load may already be in the database. Identify and remove those records before rerunning, or the second run can duplicate or conflict with them.
- Non-core file changes: The migration may have removed non-core files under the public/legacy folder, so confirm which customizations still exist before you retest.
- Backup first: Take a file and database backup of the current target and test the repair on a staging copy before touching production.
Before you start, confirm the backup restores cleanly, because an in-place repair leaves no earlier state to return to.
Rebuilding means setting up a new SuiteCRM 8 environment, then running the migration again from the prepared SuiteCRM 7 instance. It fits when the cause is unclear, when the target has already been changed by several attempts, or when a wrong package or misplaced folders have spread into the database and file tree. The clean environment removes the state that causes repeated errors, although it adds setup work and a fresh validation cycle.
- Fresh target: A new environment avoids leftover cookies, stale sessions and half-written data from earlier runs.
- Correct package: Install the migration package rather than the standard package, as named in the known issues list, and confirm the setup-legacy-migration command is present before you begin.
- Re-pointed URL planning: If you reuse the same URL, expect old browser sessions to remain, so plan to clear cookies for every tester.
- Staging first: Run the full migration on staging and review results before any production cutover.
- Backups of the source: Back up the SuiteCRM 7 files and database before each attempt, since the migration runs against that data.
Confirm that the SuiteCRM 7 source is at the required 7.14.x or later level and that the new environment matches the supported PHP, Apache and database versions in the compatibility matrix.
The choice depends on what has changed on the target and whether that state is worth keeping. A single known fault with a clean database usually points to repair. Repeated failures, unknown changes or a target that is already populated usually point to a rebuild. Either way, the deciding factor is whether you can prove what the target contains and restore it if the next step fails.
- Known versus unknown state: If you can list every change made since the last clean state, repair is safer. If not, rebuild.
- Data already loaded: Repair only when you can separate migrated records from any manual edits or test data.
- Customization exposure: If customizations were added to the target, check them against the migration notes before choosing.
- Time and access: Confirm who can change ownership, cookies and the database on your side, since both paths need those permissions.
- Written sign-off: Record the chosen path, the backup location and the staging result before production work starts.
Review the staging result and the backup restore test with the team that owns the application before you commit to either path.
Resetting file permissions after console commands run as root
This sequence returns SuiteCRM's files and folders to the ownership the web server needs, so the application can read its code and write to the directories it uses at runtime after a console command ran under a different user.
Confirm the web server user for the host
The sysadmin or platform engineer checks which account the web server runs as on this host, using the Apache configuration or the running process list for the Apache worker processes. Record the account name and group, because every later ownership change depends on it. Do not assume the name from another server, since distributions and custom builds use different defaults. The step is done when the account and group are written down and confirmed against the running process, not only the config file.
Identify the SuiteCRM directories to check
The engineer lists the SuiteCRM install directory and the folders the application writes to at runtime, including its cache, logs, upload and generated-file locations, using the paths in your own install. Include any directories that a console command might have created or rewritten. Keep a list of these paths so the review in the next step covers the whole install rather than the first folder that looks wrong. The step is done when the list is complete and agreed with whoever owns the installation.
Review ownership and permissions on those directories
Using a file listing command against each directory on the list, the engineer compares the owner and group of files and folders with the web server account. Look for entries owned by root or another administrative account, and for folders the web server cannot enter or write to. Capture a sample of the findings so the fix can be checked later. The step is done when every directory on the list has been reviewed and the mismatched paths are recorded.
Confirm the permission values with SuiteCRM guidance
Before changing anything, the engineer checks the expected ownership and permission modes in the SuiteCRM permissions guidance for the installed version, and confirms them against the installation's own setup notes. Ask the vendor or your SuiteCRM support provider to confirm any values that differ from the defaults for your deployment. The guidance is the authority here, so do not copy values from a forum post or another install. The step is done when the target values are written down and approved by the owner of the installation.
Reset ownership and permissions to the web server user
Working from a maintenance window and with a current backup of files and database, an administrator applies the confirmed ownership to the SuiteCRM directories on the list, then applies the confirmed permission modes. Run the changes as the administrative account only on the agreed paths, and avoid broad changes outside the install directory. Record the commands used so the change can be repeated on another host. The step is done when the change log shows each directory and the commands completed without errors.
Verify the web server can read and write where required
The engineer logs in to SuiteCRM as a test user through the browser and opens a page that reads configuration, then performs an action that writes to a runtime directory, such as saving a record with an attachment or triggering a cache rebuild. In parallel, the web server account is tested against the write paths with a harmless test file, which is removed afterward. The step is done when the page loads, the write succeeds, and the test file is removed.
Document the fix and the rule for future console runs
The engineer records what was found, which paths changed, the confirmed values and the verification results in the migration or operations log. The team also agrees on a rule: console commands run as the web server user, or the permissions are reset straight after. Ask your support provider to confirm this rule against the current SuiteCRM guidance for your version. The step is done when the log is filed and the rule is shared with everyone who runs console commands.
Clearing CSRF token errors after re-migrating to the same URL
An Invalid CSRF token error after a migration usually comes from session cookies left behind by an earlier attempt at the same URL, not from a broken install. When a team migrates, finds a problem, wipes the SuiteCRM 8 environment and runs the migration again against the same address, the browser can still hold cookies that the new instance no longer accepts. The documented fix is to refresh the page and clear the browser cookies for the SuiteCRM site, then sign in again. Do this before you start investigating the code or the database, because it resolves the common case in a few minutes.
Test from a private browser window or from a second browser before you clear anything in your everyday profile. If the login works in a clean session, the earlier error was almost certainly cookie state, and you can clear the stale cookies in the browser you normally use. If the error still appears in a clean session, the cookie explanation is ruled out and the problem sits on the server side. Keep a note of which browser, which URL and which account you used, so the result can be repeated and compared with the logs from the same attempt.
If the error persists after clearing cookies in a clean session, check the environment and the logs before you retry the migration. Confirm that the URL, the configured site address and the reverse proxy headers match the new instance, and that the web server and PHP settings match the environment you planned. Then review the SuiteCRM and web server logs from the failing request. Confirm the next step with SuiteCRM support or your implementation partner before running further console commands or repeating the migration, since each extra attempt against the same URL can leave new state behind.
What makes troubleshooting take hours or days
This table lists the drivers that most change how long a SuiteCRM 7 to 8 migration problem takes to resolve, and what each one does to effort. Read each row as a question to answer about your environment before you estimate the work or ask a partner for a quote. The main takeaway is that a clean first attempt on a staging instance with a known starting version usually shortens the work more than any single fix.
| Driver | Effect on effort | What to ask a partner or team to confirm |
|---|---|---|
| Earlier migration attempts on the same URL | Old session cookies and partial database or file state can add CSRF and setup errors that look unrelated to the original fault | How many attempts ran against this URL, and whether the target was reset before each run |
| Staging instance | Without staging, each failed run touches the live data and the rollback path becomes the main task | Whether a staging copy of files and database exists and was restored from a recent backup |
| Customization under public/legacy | More custom files mean more review, and the migration may remove non-core files in that folder | How many custom files sit under public/legacy and who has signed off on keeping or dropping each one |
| Non-web-server user running commands | Commands run as root or another user can leave files the web server cannot read, which breaks pages after a run | Which account ran the console commands and whether file ownership and permissions were reset afterward |
| SuiteCRM 7 starting version | An instance below the 7.14.x line must be brought up first, which adds a step before the migration itself | The exact SuiteCRM 7 version in use and whether it was moved to the latest 7.14.x or later before setup |
| Correct migration package | Using the standard package instead of the migration package leads to a missing setup command and a restart of the work | Which package file was downloaded, its name, and whether the setup-legacy-migration command is listed in the console |
What goes wrong after the first fix and how to prevent it
Clearing the immediate error does not finish a SuiteCRM 7 to 8 migration. The problems below tend to surface days or weeks later, when a user, an update or a second attempt exposes what the first fix left behind. Each card names the prevention step the documented migration advice points to.
Custom code under public/legacy
The migration may remove non-core files under the public/legacy folder, so customizations placed there can disappear without an obvious error. Before the migration, list every file in that folder that is not part of core and record who owns it. Confirm on a staging instance which of those files still load in SuiteCRM 8 and which need to be rebuilt as extensions.
Partial data after a retry
A second run against a target that already holds part of the migrated data can leave duplicate or half-loaded records. Treat each attempt as a candidate for a fresh environment rather than a continuation. Compare record counts for accounts, contacts and opportunities between the SuiteCRM 7 source and the SuiteCRM 8 target before users are allowed back in.
Permissions that break later updates
Commands run as root or another user other than the web server user can leave files the web server cannot write. The error may not appear until a later update, cache build or file upload. After any console command, reset file ownership and permissions to the web server user and check the logs for write errors before the next scheduled job runs.
A migration run without current backups
Without a recent copy of both the files and the database, a failed step may leave no clean state to return to. The SuiteCRM migration advice is to back up files and database before starting, and to test on a staging instance first. Confirm that the backup has been restored successfully at least once before the production run, and keep it until users have verified their records.
Before you migrateNo dated migration log
When a problem appears after go-live, teams often cannot tell which command, package or retry caused it. Keep a dated log of each attempt, the exact package used, the commands run, the user account they ran as and any errors seen. This record lets the team tell a leftover from an earlier attempt apart from a new fault and speeds up support requests.
Questions teams ask before fixing a SuiteCRM 7 to 8 migration
How long does troubleshooting a SuiteCRM 7 to 8 migration usually take?
The time depends mostly on how many separate problems the team hits and how quickly each one can be reproduced. The three documented problems covered here, a missing setup command, an Invalid CSRF token error and file permission errors after console commands, are usually narrow fixes once the cause is identified. Time grows when the team has not kept a clean record of which package, folder and URL it used, when the migration has been run more than once, or when customizations in the public/legacy folder need review before anything is changed. Ask any provider to base its estimate on a written list of the symptoms you see, the versions involved and whether you have a staging copy to test against. No duration is given here because none has been researched for this work.
Can our own team fix these errors without outside help?
Often yes, for the documented causes. A missing suitecrm:app:setup-legacy-migration command usually means the standard SuiteCRM 8 package was used instead of the migration package, which is named like SuiteCRM-8.7.0-7.14.x-migration in the known issues list. An Invalid CSRF token error after re-migrating to the same URL is typically caused by old session cookies, and clearing them is usually enough. File permission problems after commands run as root are fixed by resetting permissions for the web server user. The harder cases are the ones not on the known issues list, especially those involving customizations or data, where an experienced SuiteCRM administrator or engineer is worth the time.
What does our staff need to provide for troubleshooting?
Troubleshooting goes faster when your staff can provide four things. The first is access to the host or a shell with the rights to run console commands and read logs. The second is access to the SuiteCRM 7 and 8 logs and the exact commands that were run, in order. The third is a staging copy of the environment, because the SuiteCRM migration docs advise testing on a staging instance and backing up files and database before changing anything. The fourth is a named owner on your side who can approve changes, confirm business behavior and decide what counts as fixed. Also provide a list of customizations, since the migration may remove non-core files under the public/legacy folder.
Is it safe to run the migration a second time?
It can be, but only after you clear the state left by the first attempt. Re-migrating to the same URL is the documented situation that produces the Invalid CSRF token error, which is usually caused by old session cookies. Before running it again, take a fresh backup of files and database, restore to a known state if the first attempt changed data, confirm the correct migration package is in use, and clear browser cookies for the site. Test the second run on staging first. If the first attempt left customizations partly removed or altered, review those before the second run rather than assuming the migration will restore them.
When should we bring in a partner for SuiteCRM migration problems?
Bring in a partner when the problem is not one of the documented causes, when it affects live data, or when the internal team has already tried the known fixes without success. Other good reasons include customizations that need a decision about whether they keep running in the legacy layer or should be rebuilt as SuiteCRM 8 extensions, or a go-live date that does not allow for trial and error. DeployOpen implements, customizes, hardens, backs up and supports self-hosted open-source platforms inside your own infrastructure, so troubleshooting can happen in your environment with your access controls.
What should a fixed-scope quote for troubleshooting include?
A fixed-scope quote should name the symptoms in scope, the SuiteCRM 7 and 8 versions and the hosting environment, and the systems and access it will use. It should state the deliverables, such as the root cause for each symptom, the change made, the verification steps and an updated runbook. It should say how staging and production are handled, what backups are taken before changes, and what happens to issues found outside the agreed scope. Ask whether the quote is one-time or includes any ongoing support, and what recurs, such as retesting after the next SuiteCRM minor release. DeployOpen agrees scope, deliverables and timelines in writing before work starts and does not publish a price list.
How DeployOpen scopes and delivers a SuiteCRM migration fix
DeployOpen is a Chainscore Labs company that plans, implements, customizes, hardens, documents and supports self-hosted open-source platforms in infrastructure you control. For SuiteCRM 7 to 8 migration troubleshooting, we start by confirming which package, folder layout and environment are actually in use, then fix the problem on a staging copy before anything reaches production.
How we scope
- Confirm the SuiteCRM 7 version, the SuiteCRM 8 target and the migration package actually used before any change is made.
- Record the web server user, file permissions, URL history and browser or session details that affect CSRF and permission symptoms.
- Agree the fix list, staging environment, deliverables and timeline in writing before work starts, since most engagements are fixed-scope.
How we build
- Reproduce each symptom on a staging instance first, using a copy of the files and database taken before any change.
- Correct the package, folder placement and permissions, and re-run the migration command with the correct package in place.
- Test the CSRF token behavior after clearing browser cookies, and check that non-core files under the public/legacy folder were handled as intended.
How we hand over
- Document each root cause, the exact commands and file locations used, and the checks that confirmed the fix on staging.
- Provide a runbook for the team that covers re-migration to the same URL, cookie clearing and permission resets after console commands.
- Walk through the findings with your administrators so the team can repeat the steps and recognize the same failures later.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the migration fix is delivered.
- Retainers can cover SuiteCRM 8 minor release reviews, so each update is tested on staging before production rollout.
- Ask any provider to confirm in the written scope who owns backups, rollback steps and access to the production environment.

