Commit Graph

32 Commits

Author SHA1 Message Date
Ryan Mulligan
6c2f66124f regex remapping: update usage and add help description.
Here is a shell session showing what the new documenation looks like:

vagrant@discourse:~/vagrant$ bundle exec ruby ./script/discourse remap
ERROR: "discourse remap" was called with no arguments
Usage: "discourse remap [--global,--regex] FROM TO"

vagrant@discourse:~/vagrant$ bundle exec ruby ./script/discourse help remap
Usage:
  discourse remap [--global,--regex] FROM TO

Options:
      [--global], [--no-global]
      [--regex], [--no-regex]
  v, [--verbose=VERBOSE]

Description:
  Replace a string sequence FROM with TO across all tables.

  With --global option, the remapping is run on ***ALL*** databases. Instead of just running on the current database, run on every database on this machine. This option is useful for multi-site setups.

  With --regex option, use PostgreSQL function regexp_replace to do the remapping. Enabling this interprets FROM as a PostgreSQL regular expression. TO can contain references to captures in the FROM match. See the "Regular Expression
  Details" section and "regexp_replace" documentation in the PostgreSQL manual for more details.

  Examples:

  discourse remap talk.foo.com talk.bar.com # renaming a Discourse domain name

  discourse remap --regex "[/?color(=[^]]*)*]" "" # removing "color" bbcodes
2017-01-30 14:27:45 -08:00
Ryan Mulligan
e63faffdb2 Revert "Revert "FEATURE: make discourse remap optionally do regex_replace (#4367)""
This reverts commit 277e7383f3.
2017-01-19 09:33:49 -08:00
Robin Ward
277e7383f3 Revert "FEATURE: make discourse remap optionally do regex_replace (#4367)"
This reverts commit f8dda198bd, reversing
changes made to 01ced67ab3.
2016-08-08 17:05:22 -04:00
Robin Ward
f8dda198bd FEATURE: make discourse remap optionally do regex_replace (#4367)
This adds a --regex option to discourse remap to use the regexp_replace
feature in PostgreSQL. Example usage:

discourse remap --regex "\[\/?color(=[^\]]*)*]" ""

removes all the "color" bbcodes.

Also, this commit fixes the --global option, which did not work because
of how Thor processes the options.
2016-08-08 14:30:02 -04:00
Guo Xiang Tan
02d63d5bc6 FIX: Backup script with custom filename needs to include version number. 2016-08-08 09:33:50 +08:00
Sam
31c0ce3dac Revert "FEATURE: make discourse remap optionally do regex_replace" 2016-08-02 08:38:15 +10:00
Ryan Mulligan
2a257190e7 FEATURE: make discourse remap optionally do regex_replace (#4116)
This adds a --regex option to discourse remap to use the regexp_replace
feature in PostgreSQL. Example usage:

discourse remap --regex "\[\/?color(=[^\]]*)*]" ""

removes all the "color" bbcodes.

Also, this commit fixes the --global option, which did not work because
of how Thor processes the options.
2016-07-22 10:08:41 +02:00
Robin Ward
c2b769bd95 Provide hints about which files can be restored 2016-07-12 12:31:01 -04:00
Ryan Mulligan
303a02b901 FEATURE: make discourse remap optionally do regex_replace
This adds a --regex option to discourse remap to use the regexp_replace
feature in PostgreSQL. Example usage:

discourse remap --regex "\[\/?color(=[^\]]*)*]" ""

removes all the "color" bbcodes.

Also, this commit fixes the --global option, which did not work because
of how Thor processes the options.
2016-03-24 11:44:14 -07:00
Erik Bernhardson
48cb386d58 Take filename to write to as optional parameter to export_category
My discourse instance will be making regular automated public backups
of specific categories. It's preferred to be able to directly control
the path and filename of the output, rather than letting discourse
choose for me. This was already mostly supported, a filename parameter
just needed to be passed through the cli app.
2016-02-12 22:02:29 -08:00
Neil Lalonde
58610d15a1 FEATURE: export/import topics and categories from one Discourse site to another. (Early-access alpha greenlight. More to do...) 2016-01-26 19:57:54 -05:00
Régis Hanol
96c23d51a2 FIX: don't break the message bus when restoring a backup 2015-08-27 20:02:13 +02:00
Sam
78bd4508d1 Add multisite support to remap task 2015-07-23 14:39:55 +10:00
Régis Hanol
189cb3ff12 FEATURE: move migrate_to_new_scheme into a background job
- new hidden site setting 'migrate_to_new_scheme' (defaults to false)
- new rake tasks to toggle migration to new scheme
- FIX: migrate_to_new_scheme also works with CDN
- PERF: improve perf of the DbHelper.remap method
- REFACTOR: UrlHelper is now a class
2015-06-12 12:07:57 +02:00
Régis Hanol
5504622c1b rename export/import in favor of backup/restore for better consistency 2014-10-10 20:04:07 +02:00
Robin Ward
f2cca140b4 FIX: Don't break out of remap action if there is a DB error. Display it
and continue.
2014-09-08 14:21:46 -04:00
Régis Hanol
925a15c9aa FIX: proper exit status code for backup/restore scripts 2014-08-04 17:55:09 +02:00
Neil Lalonde
78ea81afb6 Revert "Pretend to allow full path to backup files". This breaks our jobs that backup to a full path. 2014-07-22 10:08:59 -04:00
riking
2ad2dee0e9 Pretend to allow full path to backup files 2014-07-15 10:23:24 -07:00
Sam
a5ad2411ef FIX: bypass views 2014-07-14 08:44:26 +10:00
Robin Ward
5b0d8d5ffd Trivial typo 2014-03-17 13:13:05 -04:00
riking
bb634bd4f5 Add request_refresh to script/discourse 2014-03-06 20:26:34 -08:00
Régis Hanol
4c941495e5 FEATURE: add readonly mode CLI 2014-02-21 17:10:53 +01:00
Régis Hanol
0caee99e8b REFACTOR: moved the export.rake task into script/discourse script 2014-02-21 16:17:00 +01:00
Régis Hanol
438f97d8b0 BUGFIX: backup/restore rake tasks weren't working 2014-02-19 15:25:31 +01:00
Régis Hanol
50273ba815 rename site setting to 2014-02-13 13:31:14 -08:00
Régis Hanol
d92c6ece63 fix script/discourse script 2014-02-13 13:31:13 -08:00
Sam
8a15e89d9d better var names 2014-01-31 16:37:05 +11:00
Sam
44dc578ff9 FEATURE: task for global rewrite, used post migration to multisite 2014-01-31 14:53:25 +11:00
Sander Datema
261860fd4b Typo in scripts/discourse 2014-01-19 18:54:49 +01:00
Sam
5a499b586f FEATURE: script/discourse import AND export 2014-01-17 12:33:42 +11:00
Régis Hanol
8a62381268 migration script 2013-11-27 22:05:06 +01:00