We've got a closet with a pair of overlapping sliding doors that hang, by their wheels, on a top-mounted rack. There's a bottom guide screwed to the floor that keeps the doors lined up. But unless a door is opened carefully and slowly, one or both of its wheels come off the track. Are there any tricks or adjustments I can make to prevent this?
Tip #1 I do a lot of remodels and the easiest way to make a bedroom look newer is take out the old hollow doors or mirrored doors and put in 6 panels. Not many closets are square either. The first thing you need to do is use the rolling mechanism to adjust the door meet the wall as good as you can. You can angle the rollers and move them up and down. Obviously your door needs to slide on the floor so you have to play with this a little. But try to get each door to match its outside wall.
Tip #2 Buy better rollers. These only cost a couple dollars at big box and if you are taking old ones out, there is no extra work. For instance the roller in Mazura's answer isn't as adjustable as the normal roller you would get at big box.
Tip #3 You want a little friction on the flooring... But that only works with carpet. If closet doors are flung open the pressure of the roller will eventually affect the track each time it jumps off. So get the doors a little lower.
Tip #4 Make sure the rollers are about 3-4 inches from the outside of each door. The closer to the middle your rollers are, the easier for them to jump.
Tip #5 Get a good light/flashlight and inspect your tracks. Most tracks are about the same quality (I am sure there are high end ones but I haven't seen them). You can have two problems with the track. First the track can be angled down. This just happens with the weight of the door over time. It actually doesn't hurt to have it angled up slightly (open side of track). For this use a wood block and hammer.
The other thing that goes wrong is the lip itself becomes deformed or it get pushed down. I would simply tap this into place with a hammer. For more deformed sections I break out the pliers. If I am having an issue I go through the whole track with pliers.
Tip #6 Grease the wheels and track.
Buy new rollers if adjustments do not avail you. To remove the door, disengage the lower track. Standing outside, tilt the bottom of door towards you. Lift slightly and the door should fall off. Insure the track is free of debris. Measure your roller arm carefully, Prime Line Products has many types and sizes. Your wheels probably don't look like this anymore, on Ebay:
Check the area where the doors run along the bottom ,on many older homes the bottom of the door runs on a small piece of iron known as a sled. If any debris plaster etc. is in the doors glide path it will lift the door when closing and will knock the roller off the track. Just use a flashlight in one hand and a long thin stick (yard stick) in the other hand and push any debris over to the side (left and right) and clear the doors path and you should be ok. Also to get the roller back on track lift the door at the bottom with a large flat head screwdriver and a block of wood and wiggle the door left, right, in and out until the roller seats on the rail. This may take many attempts unless you get lucky. Good luck , it's a real pain , but better the tearing your walls out .
If you have a gap at the top or bottom where the door and opening meet . The roller assembly is adjustable to level the door.
If there is base trim and the bottom of door is not notched out ,this will cause the door to come off track from hitting it.
There is floor mounted hardware that acts as a divider and keeps the bottom of doors in place from swinging in and out.
Over stuffed closets without this divider will cause doors to come off track.
The screws holding the roller hardware usually get over tightened and stripped out. They may need to be moved or add another screw.
Slamming the doors often is rough on the roller hardware and throws off the adjustments. Closets in kids rooms are prone to this.
Adding a 3rd roller to center of door will help with keeping doors on track for the old beat up doors.
If roller hardware has been replaced with the wrong sized rollers they will definitely constantly come off track.
Beware front door rollers are different from the back rollers.
Properly installed sliding doors that are not rough handled will work as they should.
Bifold doors work better but have their issues too but work fine when hardware and door are installed and adjusted correctly and not rough handled which is the key to using these type of closet doors.