Issue in migrating Strapi from Server A to B

System Information
  • Strapi Version: 4.19.1
  • Operating System: Ubuntu 20
  • Database: sqlite
  • Node Version: 18.18.2
  • NPM Version: 9.8.1
  • Yarn Version: 1.22.22

Hey everyone,

I’m in the process of migrating my Strapi server from Server A to Server B, and I’ve encountered an issue that’s stumping me. Here’s what I’ve done so far:

  1. I’ve successfully zipped up my Strapi server directory (/home/user/strapi) on Server A, including all the necessary node_modules.
  2. Upon unzipping it on Server B, I attempted to run yarn develop.

However, I’m getting the following error:

yarn run v1.22.22
$ strapi develop
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module '../dist/cli'
Require stack:
- /home/ubuntu/backend/node_modules/.bin/strapi
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/home/ubuntu/backend/node_modules/.bin/strapi:2:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/ubuntu/backend/node_modules/.bin/strapi' ]
}

It seems like there’s a missing module, but I’m not sure why, especially since I included everything in the zip file.

Has anyone encountered a similar issue when migrating Strapi servers? Any suggestions on a more reliable method for moving Strapi to another server?

Any help would be greatly appreciated! Thanks in advance! :pray: