Configuration
Since Trek is a multi-environment add-on, all of it's configuration is managed in a config array. You will need to add the $config['trek']
array to your user/config/config.php
file. The only required option is the 'environments' = []
array.
At a minimum, you will need to add the following to your user/config/config.php
file. This assumes you have a single remote database, such as your production site, that you are releasing migrations to. All other options will retain their default value.
For more advanced configuration, Trek will perform an array_replace()
with it's default options (seen below) with what is in your config.php
file, thus if you don't need to change anything else like requireBackup
, or threshold
, and want to use the default values, then you don't need to add them to your config.php
file.
Your environments can have any name you want, but the hostname
, database
, username
, and password
are all required. The last environment in the array is assumed to be your production environment, regardless of the array key name.
Default configuration
As noted in the code above, everything in the 'migrate' = []
array can be overridden in your site's user/config/config.php
file, but it is not recommended and in most cases not necessary.
For example, if you choose to set 'Member' => false
, which means no updates to your exp_members
table will be released to a remote environment. There may be a use case for this, and you can choose to go that route, but you're doing so at your own risk.
All support requests assume your migrate array values are identical to the ones above, or what is found in the trek/Config/settings.php
file. If the array differs in anyway, BoldMinded may not be able to assist you with your support issue.
Storage
By default Trek saves all migrations and database backups in your user/cache
folder, but it is recommended to save migrations to a different location. Trek only uses the default user/cache
folder because it should be writable as part of ExpressionEngine's default configuration. It is common for 3rd party add-ons to flush the cache, so you want to avoid having your migrations accidently deleted by another add-on. For this reason it is highly suggested to choose another local directory path, or use an Amazon S3 bucket. You can manually relocate your migration files as needed. For example, if after installing Trek some migrations are saved to the user/cache
folder, you may want to move them to a directory above the web root. If your public directory is /var/www/html/public
, you may want to save migrations to /var/www/html/migrations
. To do that, change the storage['local']['path']
value in your config file, then move the migration files to that new folder. The same process may be taken if you decide to add an S3 bucket in the future. If a migration file goes missing, and an error occurs in a remote environment because a query, or group of queries were not executed, BoldMinded can not assist with such errors.
As noted in the default configuration array, if storage['s3']
is provided, then Trek will save all migrations to the defined bucket. BoldMinded does not provide support in creating and configuring permissions to S3. If you have issues connecting to the bucket, you will receive an error message and will need to self diagnose and fix the issue.
Database backups are not currently saved to S3. The backup routine uses ExpressionEngine's native backup services and by default will save the database backups to the user/cache
directory on the server you initiated the backup command on. For example, if you are releasing from a development site to production, and issue the backup and release command from the development server, then the production databases' backup .sql
file will be saved in your development server's user/cache
directory.
Last updated