You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-3Lines changed: 45 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,28 +105,58 @@ This theme uses the following files for linting:
105
105
106
106
### Syncing Environments
107
107
108
-
The preferred mechanism for syncing your environment with others is to use database imports and exports. This repo has a few scripts to make this process as easy as possible. While your containers are running, you can run any of these commands to import, export, or backup a database. Here are the quick commands, with more instructions below.
108
+
The preferred mechanism for syncing your environment with others is to use database/uploads imports and exports. This repo has a few scripts to make this process as easy as possible. While your containers are running, you can run any of these commands to import, export, or backup a database or your `uploads` folder. Here are the quick commands, with more instructions below.
109
109
110
110
```sh
111
111
# import a DB from the `sync/sql` folder
112
112
npm run import:db
113
113
114
+
# import images/files into your uploads folder from a zip file in `sync/uploads`
115
+
npm run import:uploads
116
+
117
+
# run both a DB import and an uploads import at once
118
+
npm run import
119
+
114
120
# export your DB
115
121
npm run export:db
116
122
117
123
# export your DB with a custom name
118
124
npm run export:db validation-data
119
125
126
+
# export your uploads folder as a zip file
127
+
npm run export:uploads
128
+
129
+
# export your uploads with a custom name
130
+
npm run export:uploads validation-uploads
131
+
132
+
# run both a DB export and an uploads export at once
133
+
npm run export
134
+
135
+
# run DB/uploads exports with a custom name
136
+
npm run export validation
137
+
120
138
# backup your DB in case you need to restore it later
121
139
npm run backup:db
122
140
123
141
# backup your DB with a custom name
124
-
npm run backup:db work-in-progress
142
+
npm run backup:db work-in-progress-data
143
+
144
+
# backup your uploads folder in case you need to restore it later
145
+
npm run backup:uploads
146
+
147
+
# backup your uploads folder with a custom name
148
+
npm run backup:uploads work-in-progress-uploads
149
+
150
+
# run both a DB backup and an uploads backup at once
151
+
npm run backup
152
+
153
+
# run DB/uploads backups with a custom name
154
+
npm run export work-in-progress
125
155
```
126
156
127
157
#### Importing Databases
128
158
129
-
You can import databases from production, a saved backup, or another developer's DB export with the `import:db` script. To use it, put a `*.sql.gz` file in a top-level `sync/sql` folder in the repo and run `npm run import:db`. This will first back up your existing database in case you need to revert back to it, and then it will import the database from the given file, effectively replacing your database with a new one.
159
+
You can import databases from production, a saved backup, or another developer's DB export with the `import:db` script. To use it, put a `*.sql.gz` file directly inside of a `sync/sql` folder in the repo and run `npm run import:db`. This will first back up your existing database to `sync/sql/backups`in case you need to revert back to it, and then it will import the database from the given file, effectively replacing your database with a new one. The imported SQL script will then be moved to `sync/sql/previous-imports`.
130
160
131
161
#### Exporting Databases
132
162
@@ -136,6 +166,18 @@ You can export your database for another developer to import or to import to a s
136
166
137
167
This will happen automatically when you import a database, but if you want to manually backup your database, you can run `npm run backup:db`. This functions nearly identically to the `export:db` script, except for using a different prefix and putting the file in `sync/sql/backups`. As with `export:db`, you can specify a name for your DB backup if you want.
138
168
169
+
#### Importing Uploads
170
+
171
+
You can import a zipped copy of the `uploads` folder from another environment, saved backup, or another developer's export with the `import:uploads` script. To use it, put a `*.tar.gz` file directly inside of a `sync/uploads` folder in the repo and run `npm run import:uploads`. This will first back up your current `uploads` folder to `sync/uploads/backups`, and then it will replace your `uploads` folder with the contents of the zip file. The imported `.tar.gz` file will then be moved to `sync/uploads/previous-imports`.
172
+
173
+
#### Exporting Uploads
174
+
175
+
You can export your `uploads` folder for another developer to import or to import to another environment by running `npm run export:uploads`. By default, this will create a timestamped zip file in `sync/uploads/exports`, but you can specify a name by running `npm run export:uploads <your-descriptive-name-here>`. The exported file will still be timestamped, but it will use the name you give it instead of the default prefix.
176
+
177
+
#### Backing Up Uploads
178
+
179
+
This will happen automatically on import, but if you want to manually backup your `uploads` folder, you can run `npm run backup:uploads`. This functions nearly identically to the `export:uploads` script, except for using a different prefix and putting the zip file in `sync/uploads/backups`. As with `export:uploads`, you can specify a name for your backup if you want.
180
+
139
181
### Atom
140
182
141
183
If you use Atom, go to Preferences > Packages. Open the `language-php` Core Package settings. Go to the Tab Type setting and set the drop down option to `hard`.
0 commit comments