WebTechKitchen; Your Web Technology Kitchen, contact us to create, or maintain your websites and other digital properties.

Platform.sh commands

Submitted by barnettech on Fri, 03/25/2022 - 10:12

Activate a new branch and have it register in platform.sh:

platform environment:activate new-feature

Importing data:

platform environment:list
+------+-------+--------+------------+
| ID | Title | Status | Type |
+------+-------+--------+------------+
| main | Main | Active | production |
+------+-------+--------+------------+

platform sql < my_database_backup.sql
or if can't determine current environment:
platform sql -e main < talktoyourdata.sql

Exporting data:

platform db:dump --gzip

Upload files

platform mount:upload
platform mount:upload --mount /web/sites/default/files --source /path/to/files/to/upload

If you get this error: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

sed 's/\sDEFINER=`[^`]*`@`[^`]*`//g' -i oldfile.sql

When using platform sql to upload a new database delete the line with "DEFINER" in it first

platform project:clear-build-cache

platform redeploy