Extract single macro from Backup

dhj49er

Well-known member
I sometimes would like to extract a single macro from a backup - I use the export all macros daily for the backup.
Currently it's impossible to extract a single macro from a backup. Consequently to do this I do the following. It starts with backing up my current macros, overwriting with the backup containing the macro of interest. Then saving that macro followed by overwriting with my current macros backup. From there I can import the individual macro that I just saved.
Long winded, time consuming and prone to accidental errors.
Why not just save individual macros?
I have over 100 and don't think that is feasible & certainly not daily.
I always save a macro before I delete it - you never know, you might need it again!
It would be great, if it's feasible, to select a saved backup file and offer the option to list all the macros in the backup. From there the ability to select one (or more) to restore and then to restore the selected macro(s) would be great.
 

tanutanu

Well-known member
You can export a macro tapping share maceo on upper right corner ... menu on each macro source code. However, it is not executed automatically though;)
I can understand what you want and I hope the feature implemented in future update:)
 
Last edited:

dhj49er

Well-known member
Yes I know how to share/save a single macro, but as you say, it's not executed automatically, and I couldn't contemplate sharing 100 macros using this method.
 

Andydroid

Member
I'm after a similar thing but approaching it from a different direction:

I'd like to write a macro that allows me to select a macro from a list (like Macro Run [User Prompt]) and then assign the name to a variable and then export the selected macro only. Something like an Export Macro [User Prompt] action...
 

tanutanu

Well-known member
Finally, I wrote a easy macro working with jq command on Termux today. After adding some small features and clean it up, I wiil release on the macro store.
 

Attachments

  • iduwiSx.png
    iduwiSx.png
    258.1 KB · Views: 17

dhj49er

Well-known member
Finally, I wrote a easy macro working with jq command on Termux today. After adding some small features and clean it up, I wiil release on the macro store.
It looks an interesting macro, but I'm not sure it addresses my feature request - select a macro to restore from a backup file.
 

dhj49er

Well-known member
I think the feature could be added to Macro import.

A second option - import from Backup file

Selecting this would allow the user to select a backup file.

The macros in the backup file would be displayed as a name scrollable list .

The user could select a macro to (optionally) view before restore or select multiple macros to restore.
 

tanutanu

Well-known member
It looks an interesting macro, but I'm not sure it addresses my feature request - select a macro to restore from a backup file.
The macro makes .macro files one by one. It means easy to add the extra feature to export a specific macro. However, i need to consider the management method of each macro filename and last update timestamp, plus the UI to chose a certain macro.
I'm still working but the prototype is ok, no problem for daily full backup.
 

Attachments

  • zjqNKj4.png
    zjqNKj4.png
    718 KB · Views: 7

dhj49er

Well-known member
The macro makes .macro files one by one. It means easy to add the extra feature to export a specific macro. However, i need to consider the management method of each macro filename and last update timestamp, plus the UI to chose a certain macro.
I'm still working but the prototype is ok, no problem for daily full backup.
So far the macro replaces a single full backup file with individual macro files. I can see what you are trying to do, but it doesn't address the requested feature to restore an individual macro from a full backup file.

I have daily full backup files going back years covering several devices. I zip the daily files to produce a single monthly zip file and put the full year monthly zip files in a folder.

What I would like to be able to do is select a macro from a previous full backup file (in my case having manually extracted it from the zip file)

See my previous message in this thread for how I envisage this would be implemented.
 

tanutanu

Well-known member
So far the macro replaces a single full backup file with individual macro files. I can see what you are trying to do, but it doesn't address the requested feature to restore an individual macro from a full backup file.

I have daily full backup files going back years covering several devices. I zip the daily files to produce a single monthly zip file and put the full year monthly zip files in a folder.

What I would like to be able to do is select a macro from a previous full backup file (in my case having manually extracted it from the zip file)

See my previous message in this thread for how I envisage this would be implemented.
I understand what you want.
The macro make newest full backup .mdr file, but switching source file to another is easy, almost the same thing.
Once getting .macro files, people can chose easily to import via current MD import feature.
I mean this is the first step and already planned 1) chage target .mdr file, 2) export predefined or laat updating only, 3) quick export fancy UI. As the few minutes investigation, I decided to do by myself and share my work. That is it:)
 

dhj49er

Well-known member
I see what you are doing.

A macro could provide the requested feature and look forward to your finished macro, assuming you carry on developing the macro

However, I still think hard coded into Macrodroid is my preferred solution.
 

tanutanu

Well-known member
Just added the above 1 and 3 features, but still under development. It's also around 10 times faster then the previous version.
I'm planning other functions like:
1) getting the time/content differences with the previous extract and do it newer only(or whichever),
2) adding any .macro from another .mdr same as import function of MD app but after viewing the differences.
The successor might be another macro. Everything in it is better but it became to large and heavier. I feel the lag when opening it.

 
  • Love
Reactions: 420

420

Active member
Just added the above 1 and 3 features, but still under development. It's also around 10 times faster then the previous version.
I'm planning other functions like:
1) getting the time/content differences with the previous extract and do it newer only(or whichever),
2) adding any .macro from another .mdr same as import function of MD app but after viewing the differences.
The successor might be another macro. Everything in it is better but it became to large and heavier. I feel the lag when opening it.

You know you can just attach a (macro) file to your post directly right? There is no need to upload it to mediafire first :p
 

tanutanu

Well-known member
You know you can just attach a (macro) file to your post directly right? There is no need to upload it to mediafire first :p
Yep, I know. Thanks, but it's my regular workflow;)
I like to share it for local guys as anonymous, some of them know I wrote here though.

I noticed the .mdr file doesn't have each last actived timestamp which is managed in another hidden data file, so I changed my mind, tracking when extract .macro and from which source .mdr was used to extract. File merger itself seems not so hard but I have to struggle with fairly slow plugins...:(
Now it's about 200KB with the documentation...
 

AhmedZ

New member
Is there a way to extract a specific macro from a backup MDR file? Even via computer.
I have a set of macros from another phone and I don't want to restore the whole backup and replace my current macros in order to get one macro.
 

dhj49er

Well-known member
Is there a way to extract a specific macro from a backup MDR file? Even via computer.
I have a set of macros from another phone and I don't want to restore the whole backup and replace my current macros in order to get one macro.
Not that I am aware of.
Faced with this situation, I would do the following.
Backup your current macros.
Restore your backup with the specific macro.
This will overwrite your current macros
Select share the specific macro - select your file manager from the share list and navigate to and save to a folder.
Restore your current macros from backup.
Import the specific macro from the folder.
This will add the specific macro to the current macros.
Whilst it looks a long tedious procedure, it actually is quite quick and easy.
Fortunately Macrodroid backup and restore works really well.
Good luck if you try this out.
 

AhmedZ

New member
Thanks, will try that. Was hoping I could open the MDR file to pick out one macro.

For the backup file being used do I have to use the MDR generated by the auto-backup or the Export/Import? Or is the one generated from the MacroDroid action sufficient and complete? I was reading threads that indicated there were differences between the three.
 

dhj49er

Well-known member
Thanks, will try that. Was hoping I could open the MDR file to pick out one macro.

For the backup file being used do I have to use the MDR generated by the auto-backup or the Export/Import? Or is the one generated from the MacroDroid action sufficient and complete? I was reading threads that indicated there were differences between the three.
I do the following.
I have a macro that runs once a day to auto Backup my macros to a file on my phone.
In addition before over writing my current macros I export the macros to another file on my phone.
I usually use the exported file for the restore as this is the most recent, but sometimes I have used my auto backup file.
I have the Macrodroid auto backup enabled but so far have never used it for a restore. It's enabled as I prefer to have a few sources of Backups just in case there are any problems with one of the Backups.
I haven't noticed any differences in using either of my backup files when restoring.
 
Top