Guide to Updating Server for Windows 7
Posted: Sat Apr 04, 2015 2:41 am
EDIT NOTE: I've noticed that my fork is no longer merging using this method, but my files are updating. So this is still a good method, I've just edited the end "Pull" to instead "Push" the updated files to your repository. Feel free to ask for help if needed and I'll do what I can.
I've learned a ton from everyone on these forums and from setting up my own server. I've always been good at writing out guides and I've noticed that running a server on Windows can be difficult. So I'm hoping that this guide will be helpful to those people and in this way, I at least feel as if I'm contributing to this project in some small way.
The following is a Step by Step "Let me hold your hand through this process" guide on how to Fork your own Repository copy of the darkstar project, then using that Fork for updating your server.
I use Windows 7 Professional and am not familiar with Windows 8, so if this doesn't work for 8, I'm sorry .
Also, you should already have Git and Tortoisegit installed.
Let's begin.
First you need to go to the darkstar github here: https://github.com/DarkstarProject/darkstar and create a Github account if you haven't yet.
Once you have an account created, return to the darkstar git using the link above. You'll see a clickable labeled "Fork" on the top right. I have it in a purple box in the below pic.
Once you get it Forked, you'll see the title of the project change from DarkstarProject/darkstar to "YourAccount"/darkstar.
Next we follow the steps provided here https://wiki.dspt.info/index.php/Building_the_Server to Clone and get our darkstar folder. But, we need to clone our new fork instead.
Backup any files you've edited for your server and take the sql files associated with character info and stash them somewhere. There's a nice .bat file you can use found here: viewtopic.php?f=16&t=2440. You will have to do some editing to get it to work or you can manually take away the files.
When you're ready, delete the darkstar folder you have and clone a new one. In the clone window, use your fork url which will look like: https://github.com/"youraccountname"/darkstar.
With our new darkstar folder cloned from our own github, we can now control when we update and what we commit without panic. I recommend finishing setting your server up before continuing so that you have your Conf and settings files edited and ready to commit.
Setting up TortoiseGit -
Right click the darkstar folder, hover over TortoiseGit, then go down to Settings. You should get the below picture.
Click on Remote to bring up the window in the pic above. In the pic you'll see that my origin is my fork which is https://github.com/Desufire/darkstar. Yours should say the same thing except Desufire will be whatever your GitHub account name is.
We need to add an upstream which will be the actual DarkstarProject so that we can get their updates. To do this, just delete the "origin" name and type upstream. Click Rename for the name to stick, then put this: https://github.com/DarkstarProject/darkstar in the url part. Click the ADD/NEW SAVE on the bottom once done. It should look like this when you're done.
Commit -
Now we'll go into Committing and Pushing your commit to your fork.
You should have your Conf and settings files to commit at the least, but it's ok if you have more. Right click anywhere in the darkstar folder and select Git Commit master.
The above window should show and you'll see all the files you've edited in the bottom window. In this pic you see my server message.fr file. Type a message in the top box and make sure all other options look like the pic options. You can click Add Author and/or Add Time if you'd like. These just add your name and the date/time you performed the commit. Click Okay when you're satisfied.
You should see what the above pic shows once you hit Okay for your Commit and it finishes. Now we click the Push button in that window.
This will send those files to your fork. Be sure that your options match the pic! If you see "upstream" anywhere, DO NOT PUSH!
Configuring and Syncing your Fork -
Right click on the darkstar folder itself and select Git Bash.
You'll see a command prompt window. When it's ready to receive commands you'll see a $ symbol next to the flashing underscore.
Go here https://help.github.com/articles/config ... or-a-fork/ and follow the steps beginning with Step 2. When finished, leave the Command Prompt open and continue to next step.
Now we move on to Syncing your fork to Darkstar's.
CAUTION: The next few sectiions will perform an update, so be sure to backup your character, ah, ls, and accounts sqls.
Go here https://help.github.com/articles/syncing-a-fork/ and start at Step 3.
You can close the command prompt and right click your darkstar folder again. This time select Git Sync to get the following window.
Click Push and this will update your repository with the files you just merged from Darkstar. You've just updated using Git! Now replace any files you backed up, use the DSP_Import.bat file you get from the Building Your Server wiki (The 2nd script listed NOT the first), and do your zoneip via Navicat or whatever you use. Rebuild the servers (usually just need to rebuild DSConnect and DSGame).
Whenever you want to update, just open Git Bash and use this page: https://help.github.com/articles/syncing-a-fork/, then follow my steps for Git Sync.
I've learned a ton from everyone on these forums and from setting up my own server. I've always been good at writing out guides and I've noticed that running a server on Windows can be difficult. So I'm hoping that this guide will be helpful to those people and in this way, I at least feel as if I'm contributing to this project in some small way.
The following is a Step by Step "Let me hold your hand through this process" guide on how to Fork your own Repository copy of the darkstar project, then using that Fork for updating your server.
I use Windows 7 Professional and am not familiar with Windows 8, so if this doesn't work for 8, I'm sorry .
Also, you should already have Git and Tortoisegit installed.
Let's begin.
First you need to go to the darkstar github here: https://github.com/DarkstarProject/darkstar and create a Github account if you haven't yet.
Once you have an account created, return to the darkstar git using the link above. You'll see a clickable labeled "Fork" on the top right. I have it in a purple box in the below pic.
Once you get it Forked, you'll see the title of the project change from DarkstarProject/darkstar to "YourAccount"/darkstar.
Next we follow the steps provided here https://wiki.dspt.info/index.php/Building_the_Server to Clone and get our darkstar folder. But, we need to clone our new fork instead.
Backup any files you've edited for your server and take the sql files associated with character info and stash them somewhere. There's a nice .bat file you can use found here: viewtopic.php?f=16&t=2440. You will have to do some editing to get it to work or you can manually take away the files.
When you're ready, delete the darkstar folder you have and clone a new one. In the clone window, use your fork url which will look like: https://github.com/"youraccountname"/darkstar.
With our new darkstar folder cloned from our own github, we can now control when we update and what we commit without panic. I recommend finishing setting your server up before continuing so that you have your Conf and settings files edited and ready to commit.
Setting up TortoiseGit -
Right click the darkstar folder, hover over TortoiseGit, then go down to Settings. You should get the below picture.
Click on Remote to bring up the window in the pic above. In the pic you'll see that my origin is my fork which is https://github.com/Desufire/darkstar. Yours should say the same thing except Desufire will be whatever your GitHub account name is.
We need to add an upstream which will be the actual DarkstarProject so that we can get their updates. To do this, just delete the "origin" name and type upstream. Click Rename for the name to stick, then put this: https://github.com/DarkstarProject/darkstar in the url part. Click the ADD/NEW SAVE on the bottom once done. It should look like this when you're done.
Commit -
Now we'll go into Committing and Pushing your commit to your fork.
You should have your Conf and settings files to commit at the least, but it's ok if you have more. Right click anywhere in the darkstar folder and select Git Commit master.
The above window should show and you'll see all the files you've edited in the bottom window. In this pic you see my server message.fr file. Type a message in the top box and make sure all other options look like the pic options. You can click Add Author and/or Add Time if you'd like. These just add your name and the date/time you performed the commit. Click Okay when you're satisfied.
You should see what the above pic shows once you hit Okay for your Commit and it finishes. Now we click the Push button in that window.
This will send those files to your fork. Be sure that your options match the pic! If you see "upstream" anywhere, DO NOT PUSH!
Configuring and Syncing your Fork -
Right click on the darkstar folder itself and select Git Bash.
You'll see a command prompt window. When it's ready to receive commands you'll see a $ symbol next to the flashing underscore.
Go here https://help.github.com/articles/config ... or-a-fork/ and follow the steps beginning with Step 2. When finished, leave the Command Prompt open and continue to next step.
Now we move on to Syncing your fork to Darkstar's.
CAUTION: The next few sectiions will perform an update, so be sure to backup your character, ah, ls, and accounts sqls.
Go here https://help.github.com/articles/syncing-a-fork/ and start at Step 3.
You can close the command prompt and right click your darkstar folder again. This time select Git Sync to get the following window.
Click Push and this will update your repository with the files you just merged from Darkstar. You've just updated using Git! Now replace any files you backed up, use the DSP_Import.bat file you get from the Building Your Server wiki (The 2nd script listed NOT the first), and do your zoneip via Navicat or whatever you use. Rebuild the servers (usually just need to rebuild DSConnect and DSGame).
Whenever you want to update, just open Git Bash and use this page: https://help.github.com/articles/syncing-a-fork/, then follow my steps for Git Sync.