Hello!
We are currently undergoing a migration and I need to bulk upload attachments to existing Jira tickets from a local store; I am attempting to follow the REST API code provided on Atlassian Confluence:
curl -D- -u {username}:{password} -X POST -H "X-Atlassian-Token: nocheck" -F "file=@{path/to/file}" http://{base-url}/rest/api/2/issue/{issue-key}/attachments
I've created an API key and input this as the password with the username.
When running this I am receiving:
curl: (26) Failed to open/read local data from file/application
I have attempted moving this file into a higher location and using both parent folder and the document as the {path/to/file} but I must be missing something as I am very new to this.
Thank you in advance for any support.
Hi @Matt Smith
Are you migrating from server to cloud instance or from a cloud to cloud instance?
Hey @Prince Nyeche
Thanks for your quick response, it's cloud to cloud - as far as I am aware there is no clean way to do it,
What we're attempting is bulk download via a 3rd party application available on the Atlassian marketplace and then attempting to find a bulk upload process,
Thank you!
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Matt Smith
If you're familiar with a little bit of python, there's this script I made which does a bulk attachment from instance to instance, fetching the attachments based on JQL. All you need to do is follow the instruction on the readme.md file and you'll be able to migrate your entire attachments without the need to download it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Even though it's a server to cloud implementation, it works on a cloud to cloud instance as well. Let me know if you can use that instead or if you have any questions on it. Also i wrote this article a few months back on how to transfer attachments between cloud instances via API, you can also take a look at that too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Prince Nyeche
Thanks for your help on this,
The first solution wont work for our example as I understand as our destination project key is different to our source project key,
I will take a deeper look into the second option over the weekend, admittedly a python novice but I'm thinking our bottle neck will be the fact all of the incidents are not in our workspace currently as we are doing an incremental migration due to the source being currently worked in.
I will get back to you early next week with any success/failures I have,
Thank you for your time.
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wonder if it would work to update the project keys in the old space after the users are in the new space and then run this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good Morning @Prince Nyeche
I have successfully extracted the attachments this morning via your article.
I notice on there that this advises that the keys must be the same - as we have amended this in our workspace they will not be the same.
Looking at the csv I notice it stores Project Key and Issue Key, if I manually amend these in the CSV to match our target do you think this will be successful? Admittedly still a good amount of manual work but significantly less than manually uploading the docs.
Thank you!
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Matt Smith
Yes, if you do that it will upload to those issue keys. As long as you have the report you can manipulate anything you need. Let me know how it goes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Prince Nyeche
So I have followed the article quite strictly, I updated the CSV's Project ID, Project Key, Project name and Issue Key to match the destination Project but am receiving the following error when running the import script.
requests.exceptions.MissingSchema: Invalid URL 'ESINTG': No schema supplied. Perhaps you meant http://ESINTG?
Appreciate any assistance,
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Prince Nyeche it works!
I was misunderstanding the keyword args but after getting my head around that I can see it in action!
This has no doubt saved tens of hours of manual work and massively help with the integration and maintaining my sanity.
Thank you!
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome @Matt Smith! Glad to hear it works for you. Have a good day ahead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Prince Nyeche Does that script work for moving attachments from Server to Datacenter? please let me know.. thanks..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it works between Server to Server. Definitely, it should work for Server to Datacenter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Prince Nyeche hi, I am getting the following error:
"Please check your server credentials, as it might be wrong..."
Do I need to consider API token of Source or Target?
could you please explain.. thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Anil Kumar
It means the target instance credential is wrong. If you're connecting from server to data center. Your source credential should be your server ones and the target credential should be the one from data center. I believe you will need to use username and password for both connection. Usually, if your user exist on both instances, that should help make things a little bit clearer. If not, you can always enter the appropriate credential for each user you're connecting with. Hope that clarifies?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.