Skip to main content
PDQ.com mobilePDQ.com desktop
Support
Try Now

Managing Changes to PDQ Deploy with Git

Colby BoumaColby Bouma
·

Hi there. I’m Colby Bouma, a shiny new employee at PDQ.com on the QA team. I used PDQ extensively at my previous job and I did some crazy things with it. Today I would like to share one of those crazy things with you. It’s important to know I tend to go a little over the top occasionally 😀

Have you ever wanted a detailed history of the changes you’ve made to PDQ Deploy and Inventory? You can accomplish this with the built in Export feature and your own git repository. The Export feature creates XML files which are fairly readable and work very well with git. If you follow my workflow of exporting and committing after every change you get some handy benefits:

  • Quickly find when a change was made

  • See exactly what changed

  • Keep notes on why you made a change

  • Create a sort of undo button by importing a snippet of XML

Setting Up Gitlab and Preparing Your Workstation

1. Install and configure Gitlab.

a. Create a virtual machine with at least 2GB RAM, 20GB HDD, and 1 CPU core. You can use your favorite Linux distro, but I chose Ubuntu 16.04 for this demo. I followed to install Gitlab.

sudo apt-get install curl openssh-server ca-certificates postfix curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash sudo apt-get install gitlab-ce

b. Follow this guide

c. You should now be able to log into your Gitlab webpage and change the root password.

d. Create a user account for yourself. It’s never a good idea to run as root.

2. Create a repository.

3. Install Git on your workstation. The defaults are fine.

4. Clone the repository to your workstation.

git clone http://lnxDEMO/colby/PDQ_Settings.git

5. Create the initial export. In PDQ Deploy, go to File > Preferences > Export All.

6. Commit the initial export with the comment “Initial commit”.

git add .\Deploy_Settings.xml git commit -m “Initial commit”

7. Push the initial commit to Gitlab.

git push -u origin master

Workflow for Managing Changes to PDQ Deploy or Inventory

Perform an export after making any change. If you need to make multiple changes, do them one at a time and export after each change. This makes it much easier to look through and encourages detailed notes instead of “Huh, looks like I changed some stuff”.

1. Perform an export and save over the previous file.

2. Commit all changed files:

git commit -a

3. Press “i” to enter INSERT mode.

4. Write a comment such as “Increase ‘Backups to Keep’ to 200”. I also like to make a note of the path to the item I have changed, such as “Database –> Backups to Keep”. The first line is a brief note to summarize the commit; everything below that can be as detailed as you want. Make sure to put a blank line after the first line if you are going to write detailed notes.

5. To save and close the comment hit the ESC key, type “:x”, and hit ENTER.

6. Synchronize with Gitlab: git push origin master

(If you make multiple changes you can wait to do this step until you’re done.)

Undo Button

1. Find the snippet of code you want to restore.

2. Copy and paste it into a text editor. In this example I had to rearrange it a little bit due to how the diff was formatted. For packages you want everything between <Package> and </Package>.

3. Save it as an XML file.

4. Import it.

Don't miss the next post!

How to Block the Windows 11 Upgrade

Windows 11 is here, but that doesn't mean you have to use it. Discover several different ways to block Windows 11 from installing on your computers.

windows11
PDQ.com
© 2021 PDQ.com Corporation
Products
  • PDQ Deploy ®
  • PDQ Inventory ®
  • Pricing
  • Downloads
  • Licensing
  • Buy