Master & Cmd-R

XCloner: Using Cron to automate your backups

XCloner has quickly become my backup plugin of choice for Joomla websites, and it works very well for WordPress as well – It’s saved my but more than once, and it’s great for doing site migrations (hence the word “Cloner”). Here’s the procedure for installing and configuring it, with an added dose of Cron loving at the end:

Download and Install:

  • Click on the logo to go to their downloads page:

clip_image001

  • Download the latest version for either WordPress or Joomla:

clip_image002

  • Log into your Joomla or WordPress control panel and install the plugin:

clip_image003

  • Once you have it installed, head over to Components to configure it:

clip_image004

  • Your first task is to change the password from the default:

clip_image005

  • Click Settings:

clip_image006

  • Click on Authentication, then change the password to something else (make sure you document what the password is)

clip_image007

  • Click Save:

clip_image008

  • Now, if you go back to the main screen, all the settings are green (Authentication stays red until you change the default password):

clip_image009
Go ahead and click on Generate Backup: I normally just leave the default options in place (backup databases, backup files, automatically generate a name)

  • Click Continue to start your backup running:

clip_image010

  • It takes a few minutes to run the magic:

SNAGHTML4581d17

  • Once the backup completes it’ll give you the details of what it’s done, and the backup file name: Click Close

SNAGHTML458de73

  • If you go back to the main screen, and click on View Backups you can download the backup from there, or restore from it, or check when your last backup was done. You can also use the backup file to migrate a site from one host to the other – it’s a complete clone.

SNAGHTML459766d

Automate your backups with Cron

  • You can also set this up as a Cron job for automated backup magic – go to Configuration – Cron

clip_image014

  • The only setting I found I needed to change was to have it Delete Old Backups:

clip_image015
For everything else, just leave all the defaults and click Save.

  • Go back to the Cron Command Setup and grab this script:

SNAGHTML45b591e
Copy the script, and add on an email command at the end so you get notified when the job is complete: | mail -s “Website Backup Task” myemail@mydomain.com

And add it to the Cron jobs in your CPanel – If you have MySQL maintenance tasks set up, then you might want to consider setting it to run on a different day or time, so that your webhost doesn’t get too hammered for the entire 2.5 minutes that it takes to run these tasks. It’s probably not an issue, but if you have multiple websites hosted on your account, the host can sometimes get a bit twitchy if there’s too much happening at once, and shut you down.
SNAGHTML461adc2
Sit back and enjoy the magic!

LogMeIn Host Preference Packages

We’ve been having an issue with LogMeIn crashing when we connect to a remote computer – LogMeIn gave me an option to try, and then showed me a neat trick to apply it to all our servers at once. Rather than going to the preferences for each server individually, you can create a Host Preference Package and apply it globally, or to individual groups or computers.

 

Here’s how you create or edit the preference packages

Open LogMeIn Central, and click on Host Preferences:

image

Click on Add Package, or select one of the existing packages to edit it.

clip_image003

If you’re creating a new preference package, give it a name here:

clip_image004

From here on, the options will be the same if you are creating a new profile, or editing an existing one.

Click on the Category drop-down box:

clip_image005

There are three general settings I apply, and they’re under Network, Log Settings and Remote Control.

clip_image006

Under Network, I set the auto-update option so that the client stays up-to-date automatically:

clip_image007

Under Log Settings, I turn on debug-level logging: (This helps LogMeIn support immensely when it comes to troubleshooting)

clip_image008

Under Remote Control, I’m unchecking the option to disable wallpaper (this was the fix for BG Info crashing that I blogged about earlier):

clip_image009

Make sure you click Save at the bottom of each screen, and then when you’re done editing everything, click Finish and Save All.

clip_image011

The final step is to Assign it the computers you want it on – note that with this system, you can create different preference packages, and assign it to whichever computers you want. You can only apply these packages to computers that are on a Pro account – Free users need not apply:

clip_image012

Select all the computers you want to add from the list, and then hit the arrow to assign them to the group. Click Save when you’re done – your settings have now been applied to all the selected computers at once. This was a huge time saver, and a great way to make sure you have the same settings on all your remote computers.

Excel slow to open network files

We ran into an issue with Excel files taking a long time to open from a network location after Trend 8 was installed – the issue has something to do with the way Trend scans files before it allows them to open. One of the indicators of this problem was that when you open a spreadsheet off the server, we’d see three dialogue steps in the progress bar:

Contacting filename.xls…
Downloading filename.xls…
Opening filename.xls…

With a progress indicator beside each step, almost as if there’s a delay forcing a download of the file. When Trend is disabled, the file opens immediately – at least, the steps happen so fast that we don’t see them at all.

 

The fix that was recommended by Trend support worked for this situation:

  • Open the ofscan.ini share on the server where Trend is installed.

clip_image001

  • Find AvoidExcelSaveIssue in ofcscan.ini, and change it to 0.

clip_image002

  • Logon the web console, and go to Global settings. Click on “Save” without doing any change. This will push the AvoidExcelSaveIssue setting to client.

clip_image003

  • Wait for 5 minutes for the setting to deploy.
  • To verify if the setting was applied:

Open the registry and go to

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesTmFilterParameters

Verify that the REG_DWORD —> AvoidExcelSaveIssue = 0 is in place
Reboot machine to apply the settings – you should be good to go after the reboot. Of course, your mileage may vary

How to wrap up an Office 365 IMAP Migration

On a recent migration from hosted Exchange to Office 365 using an IMAP Email Migration, we ran into a bit of an issue when trying to complete the migration:

There’s no way to stop it gracefully!

It turns out that Microsoft has removed the Stop button, and have deprecated the PowerShell cmdlet Complete-Migration (see below).

image

clip_image002

Why is this a problem?

Well, the Stop command (or the Complete-Migration command in PowerShell) is supposed to contact the server and run one last sweep through the mailboxes for any changes that have happened since the migration started. Once it runs that final sweep and syncs any changes, it stops the migration and sends a report to whomever you have specified at the beginning of the migration. Since this is no longer an option, Microsoft suggests letting the migration run completely through and then waiting 24 hours after cutting over your MX records to allow it run another sweep.

However, an IMAP migration can take a very long time to complete, and it won’t run a second pass at your migration until it has completed at least once. So, if you’re under the gun and trying to complete your migration before the end of the month in order to avoid another billing cycle for your client on their old Exchange provider, you’re going to have to come up with a Plan B.

 

Now what? What’s my Plan B?

The answer is simple – backups! Make a backup of your OST files (Export to PST from Outlook). Once you’ve set up the Office 365 Outlook profile, you can import from the PST and it will sync up into Office 365 at its own comfortable pace, getting you out from under the gun and enjoying your weekend.

Once you’re happy that you have all your mailboxes backed up, you can pause the migration and click the delete button in the Exchange Control Panel. The does the equivalent of the Remove-MigrationBatch PowerShell command, but it does not sync any changes in your mailboxes on the server.

My final opinion:

The IMAP migration process has more glitches and gotchas than it’s worth – and here’s why:

  1. It won’t copy over calendars and contacts, so you’re forced to migrate those manually
  2. It won’t copy any folders with a forward slash in its name (/)
  3. It won’t copy any items larger than 35MB (this is the official MS word, but rumors on the community forums are that it can skip file sizes as small as 30MB – Your mileage may vary)
  4. Unlike a migration from On-Premise Exchange, it won’t tell you what has been skipped, or why
  5. It can take forever! A simple migration of 35 users ran for over a full week (168 hours) without completing a full sweep

From now on, any migrations out of a Hosted Exchange provider that I need to do, I’m going to be exporting Outlook profiles and importing them for each user. This plan of attack might take a while to get up into the cloud, but for the most part your users are not going to mind – they have everything on their computers in their Outlook profiles, and it will sync up to the cloud with no further interaction on your part. Just make sure that you have cut the MX records over first and waited a while to catch any email stragglers.

Good Luck, Have Fun!

 

Set IE10 to open in Desktop mode

 

In Windows 8, when Internet Explorer is set as your default browser, its default option is to open as a full screen App. There are several ways you can get around this:

  1. Navigate to C:Program Files (x86)Internet Explorer and open iexplore.exe, and pin it to your task bar. Internet Explorer will open as normal in desktop mode.
  2. Under Internet Options – Programs you can specify how IE handles links; either it will open them in App mode, or on the desktop. If you set that to Always open on the desktop it will open links on desktop mode, provided you’re not in the App version.

image

 

But what if you want to tuck App mode away entirely? Here’s one way that I’ve discovered:

3. In order to set IE to not open in App mode, you need to specify another browser as your default browser – here’s how you do that.

First, when you hit start, you’ll notice that the icon for IE is the new Fluid style, and not a standard IE icon.

clip_image001

Alongside that we have Chrome, which still looks like a normal icon:

clip_image002

From your start page, start typing in default to search for the option to set Default Programs:

clip_image003

When you select Chrome (or whatever other browser you want to use), you’ll see it only has 1 default (if any):

clip_image004

Click the option to Set this program as default, and that will change to looking like this:

clip_image005

And now, the icons have switched around:

clip_image006

Chrome now has a full size somewhat fluid looking icon, and IE looks like a normal icon again. Also, when you search for Internet, you’ll see that the App version of IE has been turned off:

clip_image007

Enjoy!

QNAP Offline?

Most of our clients use QNAP devices with Backup Exec – they’re amazing devices, and we love to use them. We ran into an interesting issue in the last few days, though (right after the switch from Daylight Savings Time)… we found that some of our client’s backups were failing in Backup Exec, and that the QNAP would show as being offline. And surprisingly, after flicking the switch in Backup Exec to bring it online again, it would immediately go right back to being offline.

 

Another clue to the strangeness of this problem is that if you tried to connect to it by UNC patch it would give an error about the server being misconfigured – all in all, it was acting bizarre.

 

Well, turns out the problem was a timing one – if you log onto the QNAP and select General Settings:

 

image

 

 

And then Date and Time:

image

 

You might find (as we did) that your beloved QNAP did not make the time change with your servers, or maybe that it has just fallen out of touch by more than a few minutes – which can be enough to make things fall over.

image

 

As this screenshot shows – make sure your time settings are accurate, and then make sure to set the time to synchronize automatically – either to an internet time server, or to your local Domain Controller (like what we have here). We found the time interval was set to 7 days, but a good idea would be to bump that up to a happy medium like once per day – that way your QNAP doesn’t wait a week to bring itself back on track again, and your backups don’t fail on you.

Once you get your time sorted out, you should be able to bring it online again in Backup Exec and start pushing backups out to it again.

Hope this helps… Good luck and have fun!

Exclaimer Outlook Photos

Outlook Photos by Exclaimer is a great (free!) utility for adding photos to your Exchange users and distribution groups, allowing you to put faces to names and greatly improving the social aspects that Outlook 2010 has built in (It’s also a great way of super-imposing mustaches on all your users in preparation for Movember :D).

Start by downloading the program from their website and installing it on your system. You can install it on any computer on the domain, as it will ask you where your AD is, and scan it remotely – you don’t need to install it on your server.

There are several ways to go about getting the users who need photos – you can either tell Outlook Photos to scan the entire Active Directory to find users that need photos:

image

Or you can point at a folder of photos that you’ve got prepared and let Outlook Photos match them up:

image

If you’re going to be using this option, make sure you name all your images with the correct names of the users you want to update. OP will scan through your AD and match the file names to the names of people it finds, and then ask you to manually assign any names it can’t find a match for.

 

Also, you can refine your search to a specific OU by clicking the Scan AD button:

image

 

Once you click it, a window will pop up where you can select the container that you want to search:

SNAGHTMLab1aa5a

 

If you have multiple Domain Controllers, a warning will pop up in the ribbon recommending you select a specific DC to make the changes on:

image

 

Go ahead and choose a DC, and click OK for it to search the container and show you all the users that need / have pictures associated with their profile (based on your choice of what it should display):

SNAGHTMLab26d0c

 

Once you’ve found the user or users that you want to update, double click on them in the list and select Choose Picture:

SNAGHTMLab2a857

 

Browse for the picture that you want to replace it with and click Update: note that whatever size image you choose, it will be adjusted to 96×96 pixels, so you might want to start with them at that size if you don’t want scaling silliness to ensue.

SNAGHTMLab33cd8

 

After putting your admin password in, the thumbnailPhoto field is now populated – rinse and repeat until you’ve got all your users updated.

SNAGHTMLab36752

 

One important thing to remember is that these changes won’t show up automatically, as Outlook will only sync the Global Address List once per day – if you want to force the changes sooner in order to see the magic that you have just created, open Outlook and click Send /Receive – Send/Receive Groups – then Download Address Book…

image

Enjoy!

Windows 8 Freezing Constantly?

I’ve been running Windows 8 in BootCamp on my iMac ever since the Consumer Preview was released (loving it!), but it wasn’t until I installed the Release Preview on my MacBook Pro that I ran into the dreaded and mysterious freezing problem. With no explanation and no warning, Windows would just lock up, forcing me to reboot to get it running again. The fix, thanks to Tripp Parks at Microsoft, is quite simple…

 

From an elevated command prompt run the following command followed by a reboot:

bcdedit /set disabledynamictick yes

 

Here’s what it looks like:

Fix for Windows 8 Freezing Constantly

 

If you run into this error:

image

 

It’s because you didn’t elevate your command prompt – right click on cmd in your Start Page and select Run As:

Run as...

 

Of course, your mileage may vary, but this worked for me right away – enjoy!

How to Map a Drive Letter to a SharePoint Library

Sean wrote an interesting how-to that sparked a bit of discussion between him and I on SharePoint best practices – primarily because I love being able to map a drive letter to a network resource in order to make finding what I want easier, and wanted to know why it wasn’t best practice. Here’s the steps for setting this up, and his comments on why you don’t really want to do this:

Note: I’m not endorsing this.  But this is how it is done, when the solution fits the problem.

  1. Click Map Network Drive in “My Computer” or explorer
  2. Pick your favourite letter – Cookie Monster prefers the letter C
  3. Paste in the path of the Document Library in SharePoint (for safety sake, be sure to specify a library and not the whole site or expect heartache later (for example: https://go.myportal.com/mysites/mylibrary)

Windows handles the rest, setting it to the path it needs to deliver it, in this case: \\go.myportal.org@SSL\mysites\mylibrary

That’s the How: (pretty easy, right?) – now for the Why Not:

    • Users can point and click/delete things:

Makes sense – the chances of your library getting accidentally cleaned out on a misclick are just too great – much better (and safer) to train your users to use SharePoint properly.

    • Viruses can see/use network drives:

This is a pretty big security hole, and is enough to scare me away from mapping drives to SharePoint Libraries and leaving them there. Not to say, of course, that there aren’t uses for mapping libraries to drives, but it shouldn’t be the go-to solution for all users. Explorer View is still your best friend if you need to move a lot of files at once.

  • Users aren’t using SharePoint properly (versioning, metadata) and just using it like a dropbox:

Why cripple SharePoint to be a dropbox when it can do so much more? Nuff said.

Using Cron to automate MySQL maintenance

We recently needed to go through a list of around 50 sites that we host through HostGator and optimize all of their MySQL databases. Going through each one and optimizing the database tables manually was a very unappealing process, so my trusty compatriot Keith worked out a process to use Cron jobs to automate the procedure. It took a bit of tweaking to get the right arguments in place, and a lot of looking around on the internet to fix a problem with conflicting arguments in the script, but in the end we triumphed… and man, is it awesome!

 

This is taken in the context of our site hosting in HostGator, but the process will be similar (or the same) for any site that uses CPanel.

 

First, log into your CPanel and look for the Cron jobs icon:

clip_image001

 

Update the email address that you want your Cron job to go to: in this case, we’re specifying the output, but it never hurts to have this set for any future jobs you want to run that don’t need to have a specific email output configuration. (more on this in a bit).

clip_image002

 

The next section is where you create your Cron job – in order to test and make sure everything is working, create a new job to run every 15 minutes. What, you don’t believe in testing scripts before releasing them into the wild? I… I don’t even know you any more!

image

 

Paste the following code into the command section:

mysqlcheck -u root -ppassword --auto-repair --optimize --all-databases 2>&1 | mail -s "MySQL Database Optimization" myemail

 

And click on the Add New Cron Job button

image

 

*Replace root with your username and password with your password – note that while there is a space between the –u and your username, there is no space between –p and your password, and (most importantly), there are two dashes on the auto-repair, optimize, and all-databases switches. Also replace myemail with the email address that you’d like to have the results sent to (myemail@domain.com).

 

Here’s what the individual sections mean:

mysqlcheck –u root –ppassword --auto-repair --optimize –all-databases

 

This section is pretty straightforward – runs a check on all your databases and repairs and optimizes them. If you’d like to run this against a single database, change —all databases to db_name or —databases [database1 database2] and so on.

 

2>&1 | mail -s "MySQL Database Optimization" myemail

 

This is the bit that outputs to an email address that you specify, and allows you to specify a subject for your email. If you leave this option off entirely, it will send an email upon completion to the email that you specified earlier, but it will dump the entire script into the subject line of your email, which includes your username and password – yikes!

 

If you’d like to not have an email sent at all, add this section right after all-databases:

>/dev/null 2>&1

 

Your new job will show up immediately below, and should look like this:

image

 

Once you’ve received a confirmation email, and everything is working – simply go back and create a new job that runs on whatever schedule you’d like – in our case, we chose the 1st and the 15th of every month, but you can use any timeframe you’d like.

image

image

 

Delete your test job, and you’re all set to go!

image