10. Upgrade to a new version (manual install, production mode)

These are the real steps from upgrading our own live store (0.2.13 to 0.2.16). On that upgrade the storefront showed the maintenance page for about 7 minutes; products, orders and settings did not change, and the license and the AliExpress connection stayed healthy. Your store and server are different, so your times will differ.

For you if you installed GetDropFlow by unzipping it by hand (no Composer) and your store runs in production mode. If you installed with Composer, see the "Upgrade" section of INSTALL.md inside the package.

Read this first

The most common upgrade accident: the home page turns into a 404 after the upload. When a file manager (CloudPanel, for example) uploads the package, it sets the group of ALL the shop files to the site user. The web server cannot read them, and the home page, the login page and the cart all answer 404. Run chgrp -R WEB_GROUP . from step 3 right after the upload, then go on. From 0.2.23 on, the installer script first checks that the home page opens before it changes anything; if it does not, it stops, prints this command and changes nothing.

  • The storefront goes into "maintenance" for a short time. Pick a quiet hour; look at your order count for the last 24 hours first.
  • Back up first. Do not start until the backup is made and checked.
  • Do not just unzip over the old files. Files that the new version no longer has would stay behind. Delete the five old module folders first, then unzip the new package.
  • Run the commands as the user that runs your website, not as root. Otherwise files only root can read or write are created and the storefront can break.
  • In this page, WEB_USER, WEB_GROUP and PHP stand for the real values on your server. See step 0.

How you learn that a new version exists

On shops that can upgrade with one click (0.3.4 and newer, all server checks green), a new version is announced by the "Upgrade now" card in the next section; the blue notice and the folded "Upgrade guide" below then do not appear (the card is the only message, so two messages never disagree). The blue notice and the guide appear instead of the button when it cannot be offered: a server check is red, the license server cannot be reached, or there is no upgrade package for that version.

From 0.2.20 on, the Settings page shows a blue notice under the "GetDropFlow plugin version" row when a newer version exists: "A newer GetDropFlow version is available: x.y.z". The information comes from our license server (the same channel as the admin announcements, asked at most once an hour, so the page does not slow down). If the server cannot be reached or there is no newer version, nothing is shown. The notice only tells you a new version exists; it never changes your store by itself. When you see it, follow this guide: back up first, then upgrade. (AI translation, not proofread by a person.)

Note: while the shop is in "demo mode" the Settings page does not look for new-version information, so the notice does not appear; a shop in normal operation is not affected. Shops running 0.2.19 or earlier do not have this feature: upgrade to 0.2.20 first, and the notices start after that.

The upgrade guide in the admin (0.2.23)

When a newer version exists, a folded card "Upgrade guide" appears under the blue notice on the Settings page. It only reads; it changes nothing. It shows:

  • Server checks: the PHP version of the web server (8.2 or newer), the Magento version (tried on 2.4.6 to 2.4.9), the mode (production needs a few minutes to compile), the free disk space (at least 2 GB), whether the store is already in maintenance mode, and the owner and group of app/code, var, generated and pub/static. Fix the red lines first.
  • The command to copy: it already has the Magento folder of your store. One click selects all of it; then copy. It uses --upgrade --download: the installer downloads the new version itself with your license key, and nothing has to be uploaded, so the "group changed by the upload" problem cannot happen.
  • A reminder for the file-manager way: after the upload run chgrp -R WEB_GROUP . as root in the Magento folder.

The checks on the card are a preview; the installer makes the real checks again before it changes anything. Note that the PHP version shown is the one of the web server; the command line may use another one, check it with php -v.

The "Upgrade now" button on the Settings page (stores running 0.3.4 or newer)

Screenshot

A new version is ready: tick the confirmation box (red box) and press "Upgrade now".

Screenshot

If the upgrade could not finish, the card says why in plain words and shows a reason code (red boxes). Everything was put back.

Screenshot

The "Upgrade now" button is back (red box), so you can try again.

Screenshot

When it worked, the card says the upgrade is done (red box) and the version above shows the new number.

When a newer version is released, the upgrade card on the Settings page shows an "Upgrade now" button (tick the confirmation box first). The admin then does everything itself: checks, download and checksum, backup, pause sync, maintenance mode, swap modules and database upgrade, compile, self-check, resume sync. The page shows the progress; the storefront shows the maintenance page for a few minutes. If any step fails, the old version is put back and the shop is reopened automatically. If the process is killed half-way, the card turns red and offers a "put back" button.

  • After a failed upgrade that was put back automatically, the Settings page shows the reason code and the "Upgrade now" button stays, so you can try again at once. If the card is red and says it could not be put back by itself, the store stays in maintenance mode on purpose (so visitors never see half-installed code): do not start another upgrade, send the reason code to our support; the backup is in the var folder on the server. Under the red card there are three steps (since 0.3.3): (1) leave the store in maintenance mode and check it with php bin/magento maintenance:status; (2) delete nothing: the backup is the newest folder starting with upgrade- in var/dropshipkit/backups/; (3) send support the reason code and the name of that folder; support tells you how to put everything back and when to open the store again.
  • Reason code DI_COMPILE (the compile step failed and everything was put back): while the shop is being rebuilt, visitors' requests keep writing new files into the folder that is being cleared, and the compile stops with "Directory not empty". The upgrade already tries again up to 12 times over about two minutes; in rehearsals it worked with a few visitors and failed (and was put back) when about 25 requests per second kept coming. So upgrade at a quiet time of day (night), and if it fails again use the manual steps below. The shop is always put back and reopened; nothing is lost (N1317).
  • During the upgrade the storefront shows the maintenance page, but the address of the computer you pressed the button from is let through, so this Settings page still opens and shows the progress; the address is removed again when the upgrade ends (or is put back). If a CDN or proxy sits in front of the shop and the address the system sees is not yours, the progress page may not open: wait a few minutes and reload, or use bin/magento dropshipkit:upgrade --recover on the command line.
  • You may skip versions: going from 0.3.0 straight to 0.3.4 is allowed. Only when a release names a lowest version that may upgrade straight to it (min_from) and yours is older, the card says "first upgrade to X"; upgrade to X, then press the button again.
  • When the button does not appear (server checks fail, the license server cannot be reached, no upgrade package for that version), the upgrade guide above and the manual steps below still work.
  • The package is downloaded only from the signed link the license server gives (valid for 30 minutes). Its size and SHA-256 are checked; if they do not match it is deleted and the upgrade stops with nothing changed.
  • 0.3.3 and older use the manual way below. 0.2.x has no button; 0.3.0 to 0.3.3 have one that only works on some servers and failed on a real store (0.3.3), so it is not offered as the way to go. The button appears only when a newer version is published, the server checks are green (the store's cron job runs) and no other upgrade is open. If it does not appear, use php bin/magento dropshipkit:upgrade --dry-run and then --to=X.Y.Z --yes on the command line, or the manual steps below (tutorial 28 explains the same).

Things you may see during and after the upgrade (0.3.6)

  • You pressed "Upgrade now" and nothing seemed to happen (N1346). The box in front of the button ("I understand: the store will be in maintenance mode for a few minutes.") must be ticked first. If you press the button without the tick, a yellow note appears under the box: "Tick the box above first, then press "Upgrade now". Nothing was started." and the cursor jumps to the box. Tick it and press again. (Before 0.3.6 the browser's own small bubble was the only sign, and it is easy to miss.)
  • The card says "the server could not start the upgrade" but the upgrade is running or already finished (N1341). On a shop with many visitors the upgrade process can need more than a few seconds to write its first line. Since 0.3.6 the server's cron job looks for it once a second for up to 20 seconds before it says the upgrade did not start. If the card still says so, wait one minute and reload the Settings page: if the progress line shows, or the plugin version above already shows the new number, the upgrade did start and the message was wrong; if neither happens after five minutes, nothing was changed, and you can use the manual steps below.
  • The card says "The server could not clean its caches after the new version was installed" (reason code CACHE_CLEAN, N1333). The upgrade cleans the caches itself as its last step (configuration, layout, page blocks and the page cache, and the old page files one by one, because a page file written by the web server's user can survive a clean made by the command-line user). If that command fails the upgrade is put back like any other failed step. Try again; if it fails again, send the reason code to support. The home-page check at the end of this page (look at static/version… from outside) is still the way to be sure.
  • No "Upgrade now" card, only a blue notice, although the server is ready (N1343). On a server that uses the cron job (0.3.3 and newer) the card appears only after the cron job has written its report (var/dropshipkit/upgrade/ready.json). If the cron line is missing, or was removed (for example after a restore), the Settings page shows the blue notice and the upgrade guide but no button. Put the cron line back (the line Magento's own installation guide gives: * * * * * PHP /path/to/your/store/bin/magento cron:run; look at what is there with crontab -l as the command-line user); the card appears about one minute later. This is not a fault of the plugin.
  • After you restored a backup yourself, the card still says "The last upgrade to X did not work" (N1344). The status of the last upgrade is a small file in the var folder (var/dropshipkit/upgrade/status.json), and the backup of the upgrade does not contain the var folder, so a restore does not remove it. The card disappears by itself 24 hours after that upgrade. To remove it at once, as the web user: rm var/dropshipkit/upgrade/status.json (nothing else is lost; the next upgrade writes a new one). The "Upgrade now" button stays available while the notice shows.
  • How long does it take (N1345)? Measured on live and preview shops: about 4 to 5 minutes of maintenance page when few visitors are on the shop; 3 to 5.5 minutes when many visitors come at the same time. The compile step is tried again when a visitor's request writes into the folder that is being cleared: in the rehearsals it needed up to 9 tries (the upper limit is 12); an upgrade that was made to fail on purpose used all 12 tries and was then put back correctly. Do not press the button twice and do not leave the page for the first minutes; the progress line keeps counting.
  • One red line in var/log/exception.log during the upgrade (N1342). While the new code is compiled, a visitor's request or a cron request can read a generated file at the moment it is written: a ParseError in generated/metadata/... or an error about a Proxy.php under generated/code/.... This happened at most once per upgrade in the rehearsals and the shop was not affected: the next request reads the finished file. It can be ignored. If you see many such lines, or the shop does not open after the upgrade, use "Roll back" below and send the last lines of the log to support (never passwords or keys).

New in 0.4.0

  • Three new database tables and one new cron job. setup:upgrade creates them (the "Upgrade now" button runs it). If you upgrade by hand, do not skip setup:upgrade: without it the pages Blocked products and Platform errors and fixes show a database error.
  • Nothing changes in your product files after the upgrade. The screening, the picture checks, the restricted words, the Meta file and the platform connection are all off until you switch them on.
  • A new buyer has no older version installed: use the manual-install package; the button works from the next version on.
  • Right after an upgrade the button is available again when a newer version exists: the green "upgrade done" note stays for a day, and below it the "Upgrade now" button and the tick box appear again (for example 0.3.5, then 0.4.0). If no newer version exists, only the note is shown.
  • First upgrade from 0.3.5 or older: pages look unstyled or old afterwards (N1824). The page cache of the shop can still hold pages made by the old version. In the Magento admin open System > Cache Management and press "Flush Magento Cache". If the page cache is stored as files, also empty the folder var/page_cache. Then reload the shop.
  • The "Upgrade now" button may be hidden for 24 hours after an earlier successful upgrade (N1823). Versions before 0.4.0 keep the green "upgrade done" note and hide the button for a day. This is fixed in the 0.4.0 code, so it no longer happens for upgrades made from 0.4.0 on. If you see only the note on an older version, wait until the day is over or use the manual steps.

New in 0.4.1

New in 0.4.3: "Upgrade Social posting first" on the Settings page

If Social posting is installed and older than 0.5.6, the Settings page does not show the "Upgrade now" button. It says why: a red box "Upgrade Social posting to 0.5.6 first." above the checklist of the upgrade guide, and the first line of the checklist (red, "Problem") names the installed Social version. This line always comes before every other line, so a line about config.php or env.php never hides it. Upgrade Social posting first (its own Upgrade page), then reload the Settings page: the line turns green and the button appears (within a minute on servers that use the cron job).

  • No new tables and no new cron job. A new shop address /dropshipkit/checkout for Meta shops (tutorial 27); it is off while the Meta file switch is off. The upgrade from 0.4.0 is the one-click button as before.

New in 0.5.0 (first upgrade from 0.4.3: nothing special to do)

  • What is new for you: the plan names and numbers (tutorial 07), the daily import limit (one tenth of the product limit, Free has none) and the switch Carry on by itself when the daily import allowance is used up (on by default, Settings > Default values), and the usage check-in with the list of what is sent (tutorial 31; "View what will be sent" on the Settings page).
  • Two new cron jobs (dropshipkit_usage_report, dropshipkit_daily_continue), registered by Magento itself after the upgrade; no new database tables. The cron job of the store must be running (it is also what shows the "Upgrade now" button).
  • Upgrade path: from 0.4.3 the one-click button (or php bin/magento dropshipkit:upgrade --dry-run, then --to=0.5.0 --yes) runs with the checks of 0.4.3 (compile proof, "Social first" check). From 0.4.2 or older (down to 0.3.4) use the button if the page shows it, otherwise the command or the manual steps below; the check "Social posting 0.5.6 or newer first" is not made by those older versions, look at app/code/DropshipKit/Social/BUILD-INFO.txt yourself.
  • If your store is in a maintenance window and rollback happens, shoppers may see an error page for a few minutes (UP-7, tutorial 28). Nothing is lost.
  • A new buyer uses the manual-install package (dropshipkit-manual-install-0.5.0.zip), never the upgrade package.
  • Fixes in the 0.5.0 packages (web/069): (1) gdf-install.sh --upgrade now replaces only the module folders that are in the package (Catalog, Orders, Shipping, Core, Admin). Other folders in app/code/DropshipKit/ (Social posting, Personalizer, anything else) and their lines in app/etc/config.php stay as they are. The one-click button never had this problem. (2) After a good upgrade the Settings page no longer shows an old "last upgrade failed" card for a version that is now installed. (3) gdf-install.sh --upgrade also updates BUILD-INFO.txt and VERSION in the Magento root (only if they are there). If a failed try shows "There is no download information for this version on the server yet. Nothing was changed.", the license server does not know that version yet: wait and try again, or write to support.

When the web user cannot change the configuration files (0.3.3 on, through the server's cron job)

On many servers (for example the usual CloudPanel and Hostinger layouts) app/etc/config.php and env.php can be changed only by the command-line user, not by the web user. Until now such servers showed only the manual steps. From 0.3.3 on, as long as the server's cron job is running, they get the "Upgrade now" button too:

  1. You press the button. The web side writes one small request file (var/dropshipkit/upgrade/request.json) that holds only a version and a time.
  2. The server's own cron job (run as the command-line user, once a minute) finds the request and checks it again before it starts: the version must be the newest officially published one (or the stepping stone before it), newer than the installed one, the request must be under 10 minutes old, used only once, and no other upgrade may be running. If any check fails the request is dropped, the Settings page says why, and nothing is changed.
  3. After that it is the same as before: backup, maintenance mode, install, check, and an automatic put-back on failure.

Please note:

  • After you press the button it can take up to one minute to start; the card says "The upgrade is requested. The server starts it within a minute." If nothing starts within five minutes, use the manual steps below.
  • Every few minutes the cron job checks the server (whether the command-line user may change those files, whether the disk is big enough). The Settings page shows the button only while this report is less than 15 minutes old and every check passed; no report means the cron job is not running, and only the manual steps are shown.
  • The first upgrade that can use this button is the one FROM 0.3.3 to the next version: the cron job is part of the installed version, and 0.3.1 does not have it, so 0.3.1 to 0.3.3 stays manual on such servers (on servers where the web user may write the files, 0.3.1 to 0.3.3 already works with the button).

One-command upgrade (shipped in the new package; the manual steps below still work)

Available from 0.2.20. It passed 15 tests on test shops for Magento 2.4.6 to 2.4.9, but it has not yet been used on a real shop running the official Magento package: try it on a copy first, and make your own database backup too. The manual steps below still work.

gdf-install.sh in the new package has an --upgrade mode. In order: checks → backup (database, old modules, env.php, config.php, plugin data export) → maintenance mode on → replace the modules → setup:upgrade → compile and static files (production mode) → cache flush → maintenance mode off → self-check.

bash /path/gdf-install.sh --check --upgrade /path/dropshipkit-manual-install-<new version>.zip
bash /path/gdf-install.sh --upgrade /path/dropshipkit-manual-install-<new version>.zip

The script can also download the package with your license key (the key never appears on screen or in a command; GDF_SHA256 is the checksum shown on the download page, and without it the script refuses the download):

GDF_SHA256=<value from the download page> bash /path/gdf-install.sh --upgrade --download

Rules:

  • Already on the latest version, or a package older than yours: the script refuses and changes nothing.
  • A shop that had an older version installed with Composer: the script stops before it changes anything, lists what it found and the clean-up steps (see "Previously installed an old version (Composer)" below), and changes nothing.
  • If any step fails, the script puts the old files back by itself and opens the shop again, then tells you what happened. The database is not restored automatically (that would erase orders placed since the backup); an upgrade only adds tables and columns and never deletes old data, so the old version keeps working. If you really need it, the script prints the restore command.
  • First time: your current version does not have the upgrade mode yet. Take the script out of the new package once: unzip -p new-package.zip gdf-install.sh > gdf-install.sh. After that it is one command every time.
  • In production mode the compile step can be silent for several minutes. That is normal: wait, and do not press Ctrl+C.
  • In production mode the script rebuilds the static files for: the store languages + the interface language of every active admin user (for example admin users who work in es_ES or zh_Hans_CN) + en_US. It prints that list. Upgrade, rollback and the automatic restore all do the same. If the list cannot be read (for example the database cannot be queried), it uses en_US + the shop language + the languages that were in pub/static before the run, and says "FALLBACK" clearly.
  • Before it starts, the script checks that the user who runs it can write to app/code, var, generated and pub/static. If not, it stops before changing anything and prints the fix (chown -R owner:group app/code var generated pub/static, run as root or by your host; then run the script again as the owner of the shop files).
  • Each folder keeps its own group (fixed in 0.2.22). The script reads the owner and group of app/code, generated, var and pub/static one by one before it changes anything and gives every folder back its own group. Script version 0.2.21 copied the group of app/code onto the other three. On a server where the web server user is in only one of those groups, the shop then answered 404 on the home page, the login page and the cart right after the upgrade. If that happened to you: chgrp -R <the group the folder had before> generated var pub/static (one folder at a time; the old group is in ls -ld of the backup, or ask your host), then reload the page.
  • The module folder is renamed, not deleted first (0.2.22). The old app/code/DropshipKit is renamed into the backup folder and the new one is renamed into place: the time in which the shop has no module files is a few milliseconds instead of the seconds a delete-then-copy took (a scheduled job that starts in that moment would otherwise not find the module files). The renamed old folder (old-DropshipKit in the backup folder) is deleted only after the self-check passed; if anything fails it stays there and the automatic restore uses the full copy in the backup folder as before. If the backup folder is on another disk than the shop, a rename is not possible and the script uses the old way (delete, then copy).
  • A run that failed and is repeated. If a run stopped and left maintenance mode on, the script writes a small marker file var/.gdf-installer-maintenance. When you run the same command again within 24 hours and it ends well, the script switches maintenance mode off by itself. If you switched maintenance mode on yourself in between, delete that marker file first (rm var/.gdf-installer-maintenance), or the next successful run will close your maintenance mode too.
  • If maintenance mode was already ON before you ran the script, it stays ON afterwards (the script tells you) and the page check of the self-check is skipped. Switch it off yourself with php bin/magento maintenance:disable when you want the shop open.

Step 0: find out how your store is set up (look only, change nothing)

In the server terminal, go to the Magento root folder (the one that contains app, bin and pub) and run:

pwd
php -v | head -1
php bin/magento --version
php bin/magento deploy:mode:show
php bin/magento maintenance:status
grep -h '"version"' app/code/DropshipKit/*/composer.json
ls pub/static/frontend/*/*/
df -h . | tail -1

Write down:

  1. The version you have now. The five lines should match. From 0.2.17 on, the Settings page shows it too; this command is still the reliable check.
  2. Your Magento version. GetDropFlow works with Magento 2.4.6 to 2.4.9 and needs PHP 8.2 or newer on the command line (the PHP that your Magento version supports).
  3. The languages your storefront uses, from the last ls (for example en_US, es_ES, zh_Hans_CN). In step 6 you must list all of them when you deploy static files. If one is missing, that language loses its styles. Count the admin users' interface languages too (top right of the admin: your account name > Account Setting > Interface Locale; ls pub/static/adminhtml/*/*/ shows them as well), otherwise the admin pages in that language have no styles.
  4. Free disk space, enough for a backup.
  5. The user that runs your website (owner of the files), call it WEB_USER, and the group, WEB_GROUP. Command: ls -ld app.

Below we use these. Replace them with your own:

cd /your/magento/root
M="sudo -u WEB_USER php -d memory_limit=-1 bin/magento"

php must be the same version your website uses. If the server has several PHP versions, use the one the website uses (for example php8.4). Ask your host if you are not sure.

Step 1: back up (do not upgrade without all of it)

Screenshot

The red box marks the button that downloads a copy of the plugin's own data (Settings page). It does not replace the database backup.

B=/root/backup-gdf/before-NEWVERSION
mkdir -p $B && chmod 700 $B
cp -a app/code/DropshipKit $B/DropshipKit-before
cp -a app/etc/env.php app/etc/config.php $B/
$M module:status > $B/modules-before.txt

Database backup: make a full backup with mysqldump (or the backup feature in your host's panel). Read the database user and password from app/etc/env.php; never paste them into a chat, a document or a screenshot. Then check two things:

  • The file is not empty.
  • The end of the file has a Dump completed line, and the number of tables inside matches the live database.

A whole-server snapshot is even better, if your host offers it (for example a VPS "snapshot"). Create one before the upgrade. It can put the whole server back to that moment and is your last line of defense. Note: a host usually keeps only one snapshot, it has an expiry date, and restoring it loses orders placed after the snapshot. So it is an extra safety net, not a replacement for the backups above.

Can the backup really be restored? If you can, restore the database backup into a temporary database once and compare row counts of a few key tables (orders, products, tables that start with dropshipkit_) with the live one. In our own upgrade this step was not possible (the website's database account may not create databases), so we marked it "not verified" and relied on the integrity check plus a whole-server snapshot.

Plugin data export (from the new version on; one more safety net): on the Settings page, at the bottom of the license box, click "Download plugin data backup", or run $M dropshipkit:backup:export on the server. You get a file dropshipkit-backup-DATE-TIME-vVERSION.jsonl with your GetDropFlow settings, product links and order notes. It does not contain your license key or your AliExpress sign-in (the file says which entries were left out). The file made by the command is kept in var/dropshipkit/backups/, readable only by the user that runs the website; the newest 10 are kept automatically. This is not a backup of the whole store and does not replace the database backup above. Its purpose: if the plugin's tables go wrong during the upgrade, you still hold a copy to check against and recover from. To restore from it, contact our support; do not edit the database yourself. (AI translation, not proofread by a person.)

Step 2: download the new package and check it

  1. Open the download page on our website, enter your license key and download dropshipkit-manual-install-NEWVERSION.zip.
  2. The page shows the file's SHA-256 checksum. After you upload the file to the server you must compare it; see step 3.

Step 3: upload to the server and check

  1. Upload the zip to the Magento root folder (your host's file manager or SFTP both work).
  2. This is the step where things most often go wrong: an upload can set the group of ALL the files of the shop to the site user (the CloudPanel file manager does this), the web server cannot read them and the home page answers 404. Fix it right after uploading (as root; WEB_GROUP is the group the web server belongs to, ask your host if you do not know it):
chgrp -R WEB_GROUP .
  1. Check that the file is not damaged. Put the checksum from the download page on the first line:
E=CHECKSUM_FROM_THE_DOWNLOAD_PAGE
H=$(sha256sum dropshipkit-manual-install-NEWVERSION.zip | cut -c1-64)
[ "$H" = "$E" ] && echo HASH_OK || echo HASH_BAD
unzip -p dropshipkit-manual-install-NEWVERSION.zip BUILD-INFO.txt | head -4

Go on only if you see HASH_OK and the first line of BUILD-INFO.txt is the version you want. Stop on HASH_BAD and download again.

Step 4: turn on maintenance mode and swap the modules

Screenshot

After you turn maintenance mode on, maintenance:status must say "enabled" (red box). The list of exempt addresses shows your own address, with the address hidden here.

From here on the storefront shows "maintenance".

$M maintenance:enable
[ -d app/code/DropshipKit/Core ] && rm -rf app/code/DropshipKit/Admin app/code/DropshipKit/Catalog app/code/DropshipKit/Core app/code/DropshipKit/Orders app/code/DropshipKit/Shipping
unzip -q -o dropshipkit-manual-install-NEWVERSION.zip "app/code/*"
chown -R WEB_USER:WEB_GROUP app/code/DropshipKit
find app/code/DropshipKit -type d -exec chmod 2770 {} +
find app/code/DropshipKit -type f -exec chmod 660 {} +
grep -h '"version"' app/code/DropshipKit/*/composer.json

The user that unpacks must be able to read the package. If the package sits in a folder only the administrator can read (such as /root), sudo -u WEB_USER unzip fails after the old modules are already deleted, and the shop stays on the maintenance page until you unpack again (the live 0.3.0 upgrade lost about 47 seconds this way). Copy the package to a place the web user can read first, or unpack as the administrator and run the chown on the next line afterwards.

Pause cron before the upgrade. A cron run during the upgrade competes for the same files. Put the original cron entries back after step 7 and check they match the backup copy.

The last line should show the new version five times.

Is the shop in developer mode? Check $M deploy:mode:show. In developer mode a page visit makes the web user create files in generated/ that the user who runs the commands cannot delete, and the compile fails. Before upgrading, give them back to the command user:

chown -R WEB_USER:WEB_GROUP generated

(Replace WEB_USER with the user that runs the commands. A shop in production mode does not need this.)

Step 5: database upgrade and code compile

Screenshot

When the compile has finished, the last line says "Generated code and dependency injection configuration successfully." (red box). If it stops with "Directory not empty", run it again.

First, clear the old compiled code (production mode). generated/ still holds what the OLD version compiled. If you skip this, every bin/magento command can stop at once with an error like Too few arguments to function ... exactly 7 expected (seen on a live store 2026-11-15, upgrading from 0.3.1), and the shop stays in maintenance mode. Move the folders into your backup instead of deleting them:

mkdir -p BACKUP_DIR/generated-old
mv generated/metadata generated/code BACKUP_DIR/generated-old/
mkdir -p generated/metadata generated/code

(Replace BACKUP_DIR with your backup folder. Magento builds these folders again in the next two commands. Run this before cache:clean, setup:upgrade or any other bin/magento command.)

$M setup:upgrade --keep-generated
$M setup:di:compile

On our small store setup:di:compile took under a minute; a big store takes longer. When the screen goes quiet do not close the page; wait for Generated code and dependency injection configuration successfully.

If setup:di:compile stops within a few seconds with The directory ... generated/code/... cannot be deleted ... Directory not empty, a visitor's request wrote into generated/ at the very moment the compile cleaned it (N1322). Nothing is broken: run $M setup:di:compile again, it then works. Do this in maintenance mode, and upgrade at night if you can. The one-command installer, and from 0.3.4 the "Upgrade now" button, try the compile again by themselves.

If the one-click upgrade stops, the Settings page says why in plain words. For support, the output of the command that failed is in var/dropshipkit/upgrade/commands.log in the store folder (passwords and tokens are replaced by ***); send that file together with the reason code.

During the upgrade you may see generated/code/Magento cannot be deleted. This is a known harmless message and can be ignored. Stop on any other red error and read "Roll back" below.

Step 6: deploy static files, clear the cache, turn maintenance off

Screenshot

cache:flush lists the cache types it cleared. The first line (red box) is what you look for.

Replace the language list with all the languages you saw in step 0:

$M setup:static-content:deploy -f en_US es_ES zh_Hans_CN
$M cache:flush
chgrp -R WEB_GROUP .
$M maintenance:disable
$M maintenance:status

Keep the store in production mode; do not switch modes.

Step 7: check everything

Screenshot

Settings page: the plugin version (red box) must be the new one.

Screenshot

The license must still say valid (red box).

Screenshot

The AliExpress account must still say connected (red box). Do not press anything else.

Storefront (browser or command): the home page, the sign-in page, the cart, the contact page and a product or category page must open normally; the checkout page must open (go as far as "shipping method", do not place an order). Check every storefront language.

To see the status codes with a command:

for u in / /customer/account/login/ /checkout/cart/ /contact/ ; do echo "$u  $(curl -s -o /dev/null -w '%{http_code}' https://YOUR-DOMAIN$u)"; done

You should see 200. An empty cart sent from checkout returns 302 (a redirect), which is also normal. The first request is slower because the cache was just cleared.

Home or category page has no styles/scripts, or the address still shows an old static/version… number? The upgrade script (and step 6 above) runs cache:flush after the static files are generated, so the shop's own page cache is cleared. cache:flush cannot clear what sits in front of the shop: a CDN such as Cloudflare, Varnish, Fastly, and your own browser. Purge the cache there and hard-refresh the browser (Ctrl+F5). The upgrade script reminds you of this at the end.

Still the old page after cache:flush (the address still shows the old static/version… number) and no CDN is involved? On shops that keep the page cache in files, cache:flush run by another user can leave old page files behind. Open the home page from outside (for example with curl -s https://your-shop.example/ | grep -o 'static/version[0-9]*'); if the number is old, empty var/page_cache as the web server user (the user that owns var/), then check again. This does not touch products, orders or settings; the first visitors just wait a little longer while the pages are rebuilt.

Admin: sign in and check, in order:

  1. GetDropFlow → Settings: license status is "Active" and the AliExpress account is "Connected". Press Verify now once (it only asks the license server for the status; it changes no setting).
  2. Every sub-menu under GetDropFlow opens.
  3. Every new GetDropFlow entry under Catalog opens.
  4. Sales → Orders: the list shows. Do not open any order and do not press any submit button.

After the upgrade do not change settings and do not turn on "really submit to AliExpress".

Logs: after the upgrade, look at var/log/exception.log and var/report for new files. In system.log, lines like maintenance mode is enabled during maintenance are normal (scheduled jobs were refused while the store was in maintenance); they stop after you turn maintenance off.

Watch it for an hour: are there any 5xx errors on the storefront, errors from scheduled jobs, are orders still coming in?

Roll back (use it as soon as a step looks wrong)

$M maintenance:enable
rm -rf app/code/DropshipKit
cp -a $B/DropshipKit-before app/code/DropshipKit
chown -R WEB_USER:WEB_GROUP app/code/DropshipKit
rm -rf generated/code/* generated/metadata/*   # clear what the NEW version compiled first, otherwise setup:upgrade of the old version fails (seen on preview: Unknown named parameter)
$M setup:upgrade --keep-generated
$M setup:di:compile
$M setup:static-content:deploy -f ALL-YOUR-LANGUAGES
$M cache:flush
chgrp -R WEB_GROUP .
$M maintenance:disable

You usually do not need to restore the database. If you really must, first make sure the backup file is good, then restore it; restoring loses the orders placed after the backup, so think before you do it. The whole-server snapshot is the last resort.

Previously installed an old version (Composer)

If an older GetDropFlow (DropshipKit) was put into your store with Composer (the package dropshipkit/getdropflow, version 1.0.0 or similar), the installer script stops on purpose. Installing now would put a second copy of the same module into app/code, and Magento would break. The script says this before it changes anything, in --check, in --dry-run and in the real run:

[FAIL] GetDropFlow was installed with Composer (or leftovers of it are still in this shop) ... Nothing was changed.

It also lists what it found (vendor/dropshipkit, composer.lock, or composer.json). Do this, one step at a time, in the Magento root folder:

  1. Back up the database and the shop files (or ask your host).
  2. composer remove dropshipkit/getdropflow (this already updates composer.lock. Do not run composer update without a package name: it would upgrade every package of your shop.)
  3. rm -rf generated/code/DropshipKit
  4. rm -rf var/cache/* var/page_cache/*
  5. If your shop keeps its cache in Redis/Valkey: empty only the cache database of this shop with redis-cli -n <cache database number> flushdb (the number is the database entry in the cache section of app/etc/env.php; if the page cache uses another database, empty that one too; use valkey-cli for Valkey). Do not use flushall: it also deletes the login sessions and the data of other shops on the same Redis/Valkey. The script prints these commands with the right numbers from your env.php.
  6. php bin/magento cache:flush
  7. Run the installer again (bash gdf-install.sh --check ... first, then the real run).

If app/etc/config.php only still lists DropshipKit modules but their code is gone (for example you deleted it by hand), the script just shows a yellow [WARN] and goes on: the install puts the code back and enables the modules again. Nothing to do.

Your database tables (dropshipkit_*) are kept: orders and settings stay. If Composer says the package is not installed, skip step 2.

If bin/magento stops working after step 2, the script shows a short message instead of a long error:

This looks like OLD generated code or an old cache of an earlier GetDropFlow (DropshipKit) copy.

Then: delete generated/code/DropshipKit, empty var/cache and var/page_cache, then empty only this shop's Redis/Valkey cache database as in step 5 above (flushdb, not flushall; in this state emptying var/cache and running cache:flush is not enough, the old cache in Valkey must go), run php bin/magento cache:flush, and run the installer again. The shop is never left in maintenance mode by this: if the script cannot switch it on, it stays open.

Common problems

The Settings page shows no version. How do I know the upgrade worked? Run the grep '"version"' command from step 0 and look at the five modules; if they all show the new version, it worked. From 0.2.17 on, the license box of the Settings page has a row "GetDropFlow plugin version" that shows the version the five modules share; if the five modules differ, that row warns in bold and lists each module's version, which means the upgrade was not completed: install the whole package again. Versions before 0.2.17 have no such row.

The Settings page shows an error saying the settings page class needs 15 arguments but only 14 were passed? The compiled dependency configuration is still the old one after the upgrade. Run $M setup:di:compile, then $M cache:flush, then reload the Settings page. A store that was compiled before the upgrade to 0.2.17 (production mode always is) must be compiled again after it; the commands of step 5 already include this, do not skip it. (AI translation, not proofread by a person.)

The storefront shows a 500 error or a blank page? First $M cache:flush, then chgrp -R WEB_GROUP .; if that does not help, use "Roll back" above.

The admin Settings page does not open? Look at the last lines of var/log/exception.log and send the error to our support. Never include database passwords or license keys.

I installed with Composer? This page does not apply; see the "Upgrade" section of INSTALL.md in the package. If you want to move from an old Composer copy to this manual install, see "Previously installed an old version (Composer)" above.

Order of upgrades when both plugins are installed: 1) Social posting to 0.5.7 or newer, 2) flush the Magento cache, 3) GetDropFlow. If the Settings page shows the yellow note "The daily import limit cannot be read…", Social posting is still old.