anchor.diff:              %% Connect to an existing peer
               {ok, [Node]} = mnesia:change_config(extra_db_nodes, [Node]),
               %% Write the schema to disk
  -            ensure_schema(),
  -            ?log_info("Restoring tables. Mnesia config:~n~p",
  -                      [mnesia:system_info(all)]),
  -            KeepTables = mnesia:system_info(tables),
  -            CreateTables = Tables -- KeepTables,
  -            %% Restore our old data to the new tables
  -            {atomic, _} = mnesia:restore(
  -                            backup_file(),
  -                            [{keep_tables, KeepTables},
  -                             {recreate_tables, CreateTables}]),
  -            ok = file:delete(backup_file());
  +            restore(Tables, 10);
           _ ->
               %% Only promote if we're not already a peer
               ?log_error("Attempt to promote even though we're already a peer.",
  
positive.code:         {error, {node_not_running, _}} ->
              no;
          E -> E
      end.
  
  
  
negative.code:     end,
      %% Lay down copies of all the tables.
      Tables = mnesia:system_info(tables) -- [schema],
      lists:foreach(
        fun (Table) ->
                case mnesia:add_table_copy(Table, node(), disc_copies) of
                    {atomic, ok} ->
                        ?log_info("Created local copy of ~p", [Table]);
                    {aborted, {already_exists, _, _}} ->
                        ?log_info("Have local copy of ~p", [Table])
                end
        end, Tables),
      ok = mnesia:wait_for_tables(Tables, 2500).
  