backup and restore user data?

backup and restore user data?

by Mike Sangray -
Number of replies: 5

Is it possible to backup and restore user data?

I need to do a name change. I use LDAP sync and I've figured out that I can switch the user profile to Manual, change the name to match LDAP, change the profile back to LDAP, and the LDAP sync will run without deleting the user or their data (which is what I want).

In case of error during the name change process, is there a way to backup and restore the user and their data? From what I can find, I can do a site backup and course backups, but not user backups.

Moodle v2.3

Mike

Average of ratings: -
In reply to Mike Sangray

Re: backup and restore user data?

by Przemyslaw Stencel -

Go to Site administration ► Users ► Accounts ► Bulk user actions, select all users and then With selected users... ► Download (see screenshot).

If you need to restore those users later, go to Site administration ► Users ► Accounts ► Upload users.

Hope this helps,

Przemek

Attachment 2012-09-25_202242.png
In reply to Przemyslaw Stencel

Re: backup and restore user data?

by Mike Sangray -

It looks like this is only IDs and name information. Will this process restore user data like uploaded files/assignments, etc.?

Mike

In reply to Mike Sangray

Re: backup and restore user data?

by Przemyslaw Stencel -

Will this process restore user data like uploaded files/assignments, etc.?

No, this only includes user account data. Sorry, no other ideas at the moment. Maybe somebody else will come up with another solution...

In reply to Przemyslaw Stencel

Re: backup and restore user data?

by Przemyslaw Stencel -

Or, how about this?

  1. freeze your moodle (put it in maintenance mode)
  2. make a backup of the whole moodle database
  3. make the changes you mentioned above (switch the user profile to Manual, change the name to match LDAP, change the profile back to LDAP)
  4. check if everything works as you expected
  5. if anything goes wrong, restore the database from the backup you've created (#2 above)
In reply to Przemyslaw Stencel

Re: backup and restore user data?

by Mike Sangray -

Actually, I can just do a VM snapshot on both my db server and front-end server (didn't think of that before). This is a lot for just doing a name change, though. As far as I can tell the main problem is that Moodle uses 'cn' by default as the username and as the lookup field for ldap sync (unless you override it). Either way, this is the user's moodle login name. As long as I can't specify different fields for login and ldap lookup, then this will be a problem.

Ideally, I'd like to be able to specify an LDAP field like employeeNumber as the lookup field (this will never change) and then specify a different field to use as the moodle login name. Then I would be able to change the name without a problem since the sync will be using employeeNumber and not a name field.

Thanks for your ideas.

Mike