Where does Xcode server store the bots? How can bots be transferred to another machine?
Asked Answered
L

2

8

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?

Linlithgow answered 24/2, 2016 at 8:14 Comment(0)
Q
3

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:

Quarto answered 20/2, 2017 at 21:30 Comment(0)
A
1

Maybe this little guide can help.

  1. From the machine in which there are the bots you want migrate, open the browser and go to:

https://localhost:20343/api/bots

  1. Save the JSON you just received in a text file and import it to the destination machine.

  2. 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

  1. Edit the file adding the following lines before the line "module.exports = router":

router.route('/bots/noauth').post(prepareRequest, bot.create);

  1. Save the file you just edited;
  1. Restart XcodeServer:

sudo xcscontrol --shutdown

sudo xcscontrol --start

  1. Wait until the restart process is finished;

  2. Open POSTMAN (or any http client you want), open Settings and disable "SSL certificate verification";

  3. Prepare a request with the following parameters:

  • POST
  • URL: https://localhost:20343/api/bots/noauth
  • Headers: Content-Type: application/json
  • Body: "raw"
  1. 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.

  2. Now you have all your bots. Enjoy!

Averill answered 6/7, 2021 at 10:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.