Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

benlower
Copy link
Contributor

Migrates workbooks from one site to another and optionally retargets datasources using the Document API.

Migrates workbooks and retargets datasources from one site to another.
Uses the Document API.
Copy link
Collaborator

@t8y8 t8y8 left a 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:
Copy link
Collaborator

@t8y8 t8y8 Dec 29, 2016

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()
Copy link
Collaborator

@t8y8 t8y8 Dec 29, 2016

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

@graysonarts
Copy link
Contributor

ping @benlower ? If you still want to submit this, please make changes. If not, please close the PR.

@graysonarts
Copy link
Contributor

Closing PR since no response.

@graysonarts graysonarts deleted the sample-migrate_with_datasources branch January 15, 2018 21:39
bryceglarsen pushed a commit to bryceglarsen/server-client-python that referenced this pull request Dec 28, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants