I've made a few commits myself and rebased and resolved a conflict.  That is 
all on `db/3154` so please review those commits (give me feedback if anything's 
not good) and use that as a starting point for the followup work.

Overall this is working well and I like how it came together.  Here's some 
areas to make it better before we merge:

* Add an ini option to control whether project export is enabled, which would 
control whether the sidebar entry is shown and admin page is accessible.  The 
task should still be runnable so that it could be submitted at 
/nf/admin/task_manager/new
* The tmpdir/tmp_dir is constructed in several places by just adding the 
project shortname.  The tmp directory should be configurable (e.g. add a 
bulk_export_tmp_path config).  Then copy that to a tmp file created with 
`tempfile.mkstemp` in the final dir so its unique & secure (in case end-users 
can write to this dir too, we don't want them to cause problems with malicious 
symlinks etc).  Then lastly, do an os.rename (which is atomic and thus also 
safe) from that mkstemp filename to a final filename which also includes the 
timestamp.  Actually, for maximum flexibility with the final filaname, lets 
expand bulk_export_path to include the file name too.  E.g. 
`/tmp/bulk_export/{nbhd}/{project}/allura-backup-{date:%Y-%m-%d-%H%M%S}.zip` 
(pass `date=datetime.utcnow()` into the format call).
* I got errors on exporting from u/admin1 since shortname has "/" in it.  
Should be able to drop u/ since nbhd has it.  I also get errors on a subproject 
or neighborhood.  Not sure what the best approach is for that.  (Don't 
necessarily need to support neighborhoods, but should support sub-projects and 
user-projects).
* The bulk_export task needs to take a neighborhood and use that in the Project 
query, since the same shortname may be present in 2 different neighborhoods.
* We want to keep Allura and its test suites with minimal dependencies on other 
tools.  So instead of TestExport using tickets & shorturl, can you use just 
wiki (which is already needed by core Allura)?  You can use the Search app to 
test that it doesn't show up.  exportable_tools_for can pass 
include_hidden=True to ordered_mounts so that hidden tools theoretically can 
export if they want.  (I think it'd be good to do anyway).
* Continuing with the idea of hidden apps doing an export, the project metadata 
could be an export from the Admin app.  Then it'd show up as a checkbox on the 
form, and within bulk_export() task it'll be handled in the main tools loop (no 
extra export afterwards needed).
* I'm glad to see the docstring on Application.bulk_export.  Can you add a line 
in the main Application docstring for the 'exportable' var too?
* Remove the try/catch surrounding `zip_and_cleanup`.  If that fails, we need 
to let it fail - there won't be a valid zip file for the user to get.
* Remove the sort by timestamp/mod_date in all the `bulk_export` queries and 
`Discussion.__json__`.  It's not really necessary and if there's not an index 
on `(app_config_id, mod_date)` for example and the result is very large, then 
mongo can error on the sort.




---

** [tickets:#3154] Users need a way to backup allura data [idt 824] NEEDS INI**

**Status:** in-progress
**Labels:** support feature-parity p2 42cc 
**Created:** Wed Nov 02, 2011 06:41 PM UTC by Chris Tsai
**Last Updated:** Wed Jul 31, 2013 09:26 PM UTC
**Owner:** nobody

https://sourceforge.net/apps/ideatorrent/sourceforge/ideatorrent/idea/824/

>SF clearly says that the backup of the project data is left to project admins:

>https://sourceforge.net/apps/trac/sourceforge/wiki/Backup%20your%20data

>Fine.

>However, there is currently no way to backup the SF2.0 tools, for instance the 
>data from the ticket tool. 

Backups would be the first step, then a way to restore (though we never offered 
that part in SF classic to my knowledge)?


---

Sent from sourceforge.net because allura-dev@incubator.apache.org is subscribed 
to https://sourceforge.net/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/allura/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.

Reply via email to