I have created multiple bots using Xcode and Xcode server. I'd like to backup these bots and transfer it to another machine. How can this be done?
All of the Xcode Server bot information is stored in a CouchDB. The path (Current as of Server.app 5.2, and Xcode.app 8.2.1) is:
/Library/Developer/XcodeServer/Database/*
/Library/Developer/XcodeServer/Database/xcs.couch
You can probably copy & paste the entire 'XcodeServer' folder from one server to another and startup the Xcode Server Service.
A couple other helpful hints when dealing with Xcode Server:
- The CouchDB instance for Xcode Server can be accessed at: http://localhost:10355/_utils/
- Check out this great series of articles on the nuts and bolts of Xcode Server: https://honzadvorsky.com/articles/2015-05-04-under-the-hood-of-xcode-server/
Maybe this little guide can help.
- From the machine in which there are the bots you want migrate, open the browser and go to:
https://localhost:20343/api/bots
Save the JSON you just received in a text file and import it to the destination machine.
From the destination machine, open a terminal and:
cd /Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/xcs/xcsd/routes
sudo nano routes_bot.js
- Edit the file adding the following lines before the line "module.exports = router":
router.route('/bots/noauth').post(prepareRequest, bot.create);
- Save the file you just edited;
- Restart XcodeServer:
sudo xcscontrol --shutdown
sudo xcscontrol --start
Wait until the restart process is finished;
Open POSTMAN (or any http client you want), open Settings and disable "SSL certificate verification";
Prepare a request with the following parameters:
- POST
- URL: https://localhost:20343/api/bots/noauth
- Headers: Content-Type: application/json
- Body: "raw"
One at time, paste into the BODY the items of the "results" array contained into the JSON you saved at the point 2, and send the request.
Now you have all your bots. Enjoy!
© 2022 - 2024 — McMap. All rights reserved.