For those wondering what BiotrackTHC is, it's probably the most widely used Marijuana Point of Sales system in the US. Not *just* point of sales, but to their credit they also run many of the state tracking databases as well.

My client runs on a Trial window server, with less than 25 days left on the trial. This runs within an ESXI Virtual machine. Last week we purchased a legit copy, and found out through calling Microsoft that the licensed copy cannot be used to activate the trial version. With the servers eminent shutdown looming, and Biotrack not returning our calls for help, I had to figure out something.

Today I was looking over my articles I've written. In paticular, the DRBL article I wrote a while back. I wrote kickstart scripts that cut down our install time. I used one weird trick for getting the DB over, I just copied the entire DB data directory from a working server. No reading in SQL, no muss, no fuss. It worked. That was a Mysql server however. The BiotrackTHC server runs on postgres, but would the same concept of just running the installer, and copying things over work?

Installing the client yourself.

I've been installing the BiotrackTHC client on our registers on my own for a while now. It's a very simple process. The BiotrackTHC tech will have left 2 files on your server. server_setup.exe and client_setup.exe. The client is a snap to install. Just your standard next next next finished install wizard. It's the post-install setup that can get tricky.

Once you've run the client_setup.exe, switch over to a machine Biotrack has setup in the past, one that's already running and working. Look for a folder called default-7. It's usually located in C:\Program Files (x86)\BTMSI\BioTrackTHC

Now copy this folder over to the new install, in the same directory. This contains your certificates. Now run Biotrack on the new machine. It'll go through some updates and you'll arrive at the next screen.

Check on "Shared Database" and it will bring you to this screen.

Check on "Requires SSL" and put your host IP in (Would be nice if this supported FQDN) then hit OK. At this point, you should be able to run the client, and log into your server like normal.

Migrating a BiotrackTHC server.

You might think this is a little more involved but it isn't. Same concept, you're running the installer, then copying files over. Since this is a topic for more advanced users, hopefully I can just list what you have to copy.

So run the server_setup.exe on the server you'll be migrating to. You'll end up at some blank window asking for a "Certificate Password". Ignore it, just kill the window at that point.

On the source server, run "services.msc" and stop the following services.

BTMSITasks

BTMSIUptime

BTMSIUpdate Service

postgres

Do the same on the destination server as well. Once those are done, you can start copying the files from the source to the new server. Copy the following folders over.

C:\Program Files (x86)\BTMSI\BTMSIServer

C:\postgres-9.2

You'll still have to register Postgres as a startup service. Go into "c:\postgres-9.2\bin" and run;

pg_ctl.exe register -N postgres -U someuser -P somepass -D "C:/postgres-9.2/data"

Go back into services.msc. You should see the postgres service now. If you try to start it, you'll get a login error. This is easy enough to fix. Double click the service and go to the "Log On" window.

Change it to a "Local System Account" Now it should start up without error. Start the postgres service, along with all the BTMSI services. Start your BiotrackTHC client and try connecting to it. If all is well, you should be able to use your BiotrackTHC login, and see all of your data.

Final thoughts

A good admin looks at problems like these not as an impossible task, but rather a puzzle to be solved. Hopefully others can benefit from what I've written tonight.

Edit: Post install bugfixes.

The only thing I found not working was connecting to the server from a client. The only testing I had done before this was directly from the server to 127.0.0.1. Either turn off Windows Firewall (for the lazy like me) or allow port 5432.











