-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New sample for migrating site content #121
Conversation
Migrates workbooks and retargets datasources from one site to another. Uses the Document API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty good, very minor bits
all_workbooks, pagination_item = server.workbooks.get(req_option) | ||
|
||
# Step 4: Download workbooks to a temp dir and loop thru them | ||
if len(all_workbooks) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all workbooks = list(TSC.Pager(server.workbooks), req_options))
if all_workbooks:
source_wb.save_as(wb_path) | ||
|
||
# Step 6: Find destination site's default project | ||
dest_sites, _ = dest_server.projects.get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically could fail if there are more than 100 sites and default isn't returned in the first set, use the Pager :)
dest_sites = TSC.Pager(dest_server.projects)
target_project = next((project for project in dest_sites if project.is_default()), None)
Also, the name dest_sites
should probably be called all_projects
ping @benlower ? If you still want to submit this, please make changes. If not, please close the PR. |
Closing PR since no response. |
* Fix tableau#117 by only attempting files with the right extension inside the archive (tableau#118) * Commenting and Docstring cleanup. A few very small code cleanups (tableau#120) Add docstrings and remove clutter. I also made some very tiny tweaks to some code for clarity. * Small cleanups for various editors. Play nice with built in test-runners (tableau#121) * Add Py36, update travis to use pycodestyle (tableau#124) * Add `initial sql` and `query band` support (tableau#123) Addresses tableau#109 and tableau#110 * Prep for release of 0.6 (tableau#125) * Prep for release of 0.6 * wordsmithing the changelog
Migrates workbooks from one site to another and optionally retargets datasources using the Document API.